Skip to main content
For agent platforms, and businesses running their own agents, that give agents credentials for the people and businesses they verified. Once a person or business is verified, you can mint a credential for their agent. A credential is minted on demand, scoped to one site (its audience) and bound to one agent’s public key. A stolen credential is useless without the agent’s private key.
Before you startYou need:
  • An individual_ref whose verification is CURRENT. See Verifying an Identity.
  • The agent’s Ed25519 public key. The agent generates its own key pair. Baselayer only ever sees the public key.
  • For a business credential, also a business_ref and a VERIFIED operator link between the two. See Who Can Act for a Business.

Where the fields come from

The site decides what a credential shares:
  1. The site’s rules name the fields for each step, as a scope.
  2. The site answers an agent with 401 and a step-up. Its requirement carries the scope’s fields.
  3. You copy those fields into disclosed_fields. For a business, the person’s fields go in actor_disclosed_fields.
  4. Baselayer mints only those fields, never more. The site refuses a credential that carries more.
To see exactly which fields a mint will carry, preview it first.
For every field in plain words, see Fields a scope can list.

Presets

Instead of listing fields, a mint with level: L3 can name a preset: a named set of fields. Use one when it matches the site’s scope exactly, since a site refuses extra fields as scope_violation. A preset always shares readable values, so it can’t be used with HASH_ONLY. A mint through the API applies no preset unless it names one. A mint that names no preset and lists no fields shares no details beyond the checks that passed. To get the same list in code, call:
See the API reference.
  • The list is the same for everyone and can be cached for an hour.
  • Each preset lists the exact paths it requests on an individual mint and on a business mint.
  • is_individual_default and is_business_default mark the most conservative preset for each case (consumer_ecommerce and b2b_ecommerce), which the console preselects.

Mint an individual credential

POST /issuance/credentials with type: INDIVIDUAL mints for a verified person acting as themselves.
  • level: L2 shares only the customer ID for this site and the checks that passed, with no personal details. The same person gets the same ID at the same site every time, across agents, keys and sessions. At a different site they get a different ID.
  • level: L3 also shares the fields the site’s scope lists, sent as disclosed_fields or a matching preset. A path outside the schema is a 422 (6302).
The level you send (L2 or L3) sets what the credential shares. The verification.level inside the credential (2 or 3) records which checks passed, and Baselayer sets it from those checks, not from your mint.
Send every mint with an Idempotency-Key header. A retry with the same key and body within 24 hours returns the first response, marked Idempotent-Replayed: true, instead of minting again. Write audience as a bare domain (shop.example) or an https address with no path (https://shop.example). Queries, fragments and ports other than 443 are refused too. The site is matched exactly. shop.example and https://shop.example are two different audiences, and so are shop.example and www.shop.example. Each gets its own per-site ID. See every body field in the API Reference. The response lists the minted credentials in credentials, subject first:
  • credential is the string to hand the agent, ending in ~.
  • credential_id is the credential’s ID, the same as the jti inside it. Use it to look up or revoke the credential.
  • disclosed_fields lists what the credential actually carries, after skipping anything not on file.
  • ttl_capped is true when the end of the person’s verification shortened the lifetime you asked for.
  • environment is the environment the credential was minted in.
To set how long a credential works, send ttl_seconds with the mint. Without it, a credential works for one hour (3600). The maximum is 24 hours (86400), and a credential never outlasts the verification behind it.

Mint a business credential

POST /issuance/credentials with type: BUSINESS takes the individual body plus business_ref. It requires a VERIFIED operator link between the person and the business. Anything else is a 409 (6300). Send level: L3, the only level a business credential takes. level: L2 is a 422 (6320). The response has two entries in credentials:
  • role: subject for the business, with the business paths from disclosed_fields.
  • role: actor for the person, with the paths from actor_disclosed_fields.
Each has its own credential_id. The agent presents both together. The rest of the body is the same as the individual example. Only these fields change:

Preview a mint

Send the same body to the preview endpoint:
See the API reference. agent_key is optional and unused there. A preview runs the same checks and refusals as a mint, and signs, stores and allocates nothing. The preview returns the same envelope. Each entry in credentials shows:
  • disclosed: exactly what the mint would share, each with path, value and hashed.
  • missing_paths: what it would skip because nothing is on file.
  • authorization: on a business preview, the subject entry also has the operator authorization.

Test credentials

See the API reference for test mints and test previews. These two endpoints take the same body and mint (or preview) the same credential, signed by the sandbox issuer and recorded in your sandbox application. They work from a production key too. See Sandbox and Testing.

Disclosure modes

CLEARTEXT_AND_HASH (default) shares readable values and any hashes you request. HASH_ONLY shares only matching hashes. For how each field maps to its hash, see Readable values or hashes. For how the credential is signed and checked, see the Credential Format Reference.

Troubleshooting

Request problems

Environment problems

Next steps