Saltar al contenido

Credentials and capabilities

Every operation that is not a public read needs a credential, and every credential carries only the capabilities it needs.

View as Markdown

Token format

Send your credential as a bearer token in the Authorization header of every request.

Header
Authorization: Bearer <token>

A token starts with avz_ followed by a long URL-safe random string. Treat the whole value as an opaque secret.

Example
curl -H "Authorization: Bearer $AVANZA_AGENT_TOKEN" https://agents.avanzafibra.com/products

This read is public, so it also answers without the header. The header is what the credentialed operations need.

  • Only a hash of the token is stored on our side, so a lost token cannot be recovered: request a new credential.
  • A credential carries a set of capabilities, an expiry date and its own rate limits.
  • A request without a valid token answers 401. A valid token without the capability the operation needs answers 403.
  • Keep the token in an environment variable or a secret store. Never put it in a prompt, a log or a file you commit.

Capabilities

A credential carries a set of capabilities. Each operation checks the one it needs.

CapabilityWhat it grantsNotes
catalog:readCheck coverage and search addresses. The other catalog reads (products, packs, quotes) are public and need no capability.Coverage requires a credential on purpose: it would reveal where Avanza Fibra has network.
drafts:writeLeave a configured draft with its signed link so the customer can finish it.It does not submit orders or read them. orders:write also opens the draft.
orders:writeCreate an order on behalf of a customer, follow its status and create secure payment links.Deliberately separate from admin:write: submitting an order is a commercial act with effects (an email to the customer, marketing events, a stock reservation). You can run an agent that takes orders without it being able to touch the catalog or the email routing.
orders:readRead the order list and detail and the metrics, without full ID numbers or IBANs.For an internal follow-up bot. It creates nothing.
personal-data:readRead the personal data of an order (address, contact) and the rest of the administration reads.This is the capability that exposes the most. Do not give it to an agent that only needs to quote.
admin:writeThe administration writes that are considered safe.
payment:tokenizeTokenize a customer's IBAN from the agent platform's server (POST /agent/payment-credentials).Never granted by default and no other capability implies it, not even the service one. It is not an MCP tool: an IBAN cannot pass through a model context. Only for an agent platform that already holds payment data.

Least privilege

Give each agent only what it needs

Request only the capabilities an agent needs to do its job. A read-only credential that tries to create an order is rejected by design.

Request access

Any agent can operate this API with a credential. You request the credential by email and a person issues it: there is no automatic sign-up.

  1. Write to [email protected] with your company, the use case and the expected daily volume.
  2. Say which capabilities you need: catalog:read to check coverage, orders:write to contract and pay through a secure link. Quotes and the catalog need no credential. Do not ask for personal-data:read if you do not need it. payment:tokenize only if your platform already holds payment data.
  3. You receive the credential with its limits and an expiry date (90 days by default for new integrators).
  4. Rotate before it expires: request a new credential, change the token in your client and ask for the old one to be revoked.

Email [email protected] with the subject "Agent credential request".

Personaliza tu tarifa