Before you startYou need:
- An
individual_refwhose verification isCURRENT. 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_refand aVERIFIEDoperator link between the two. See Who Can Act for a Business.
Where the fields come from
The site decides what a credential shares:- The site’s rules name the fields for each step, as a scope.
- The site answers an agent with
401and a step-up. Itsrequirementcarries the scope’sfields. - You copy those
fieldsintodisclosed_fields. For a business, the person’s fields go inactor_disclosed_fields. - 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.
Presets
Instead of listing fields, a mint withlevel: 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:
- 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_defaultandis_business_defaultmark the most conservative preset for each case (consumer_ecommerceandb2b_ecommerce), which the console preselects.
Mint an individual credential
POST /issuance/credentials with type: INDIVIDUAL mints for a verified person acting as themselves.
level: L2shares 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: L3also shares the fields the site’s scope lists, sent asdisclosed_fieldsor a matchingpreset. A path outside the schema is a422(6302).
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.
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:
credentialis the string to hand the agent, ending in~.credential_idis the credential’s ID, the same as thejtiinside it. Use it to look up or revoke the credential.disclosed_fieldslists what the credential actually carries, after skipping anything not on file.ttl_cappedistruewhen the end of the person’s verification shortened the lifetime you asked for.environmentis the environment the credential was minted in.
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: subjectfor the business, with the business paths fromdisclosed_fields.role: actorfor the person, with the paths fromactor_disclosed_fields.
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: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 withpath,valueandhashed.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
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
Identity or link problems
Environment problems
Next steps
- Presenting a Credential: have the agent show its credential to the site.
- Managing and Revoking Credentials: find a credential you minted and revoke it.