Exchange an identity proof
No loopback capability on this listener. Fresh pinned-issuer/audience IdP proof or managed ledger actor secret authorizes the selected actor. A successful human exchange includes the current grant the issuer authorized; a managed-agent exchange keeps the token, owner and exp response. Public views are channel-writer, channel-purger, manager-caller, session-caller and transfer-writer; other views return 403. ttlSec is constrained by issuer policy and proof expiry; agent bearer cap is 300 seconds. Invalid proof or manager selection returns 401. Refused proof/view attempts share the public peer budget; successful credentials still mint when the budget is full. Origin is refused.
UTF-8 JSON; maximum 65536 bytes. An Authorization header does not replace the JSON proof.
application/json- body
Provide idpToken for a human OR owner plus actorToken for a managed agent, never both. Agent view may only be manager-caller. managerInstanceId requires manager-caller; sessionGrant accompanies session-caller; transferWriter accompanies transfer-writer. Native SessionGrant is verified against the redeemed session ledger; the nested schema documents its transport shape only.
idpToken*string1 <= lengthowner?string1 <= lengthactor?string1 <= lengthactorToken?string1 <= lengthttlSec?numberview?string"channel-writer""channel-purger""manager-caller""session-caller""transfer-writer"managerInstanceId?stringsessionGrant?Transport envelope only. Nested native fields and operation-specific constraints are defined by SessionGrant in the linked source; this schema is not a complete native command contract.
transferWriter?Successful response.
application/json- response
token*string1 <= lengthowner*string1 <= lengthexp*integer0 <= valuegrant?Current issuer-authorized agent grant. Present for a human IdP exchange and absent for a managed-agent secret exchange.
curl -X POST 'https://auth.example.invalid/exchange' \ -H 'Content-Type: application/json' \ -d '{ "actor": "worker", "idpToken": "<idp-token>"}'{ "token": "string", "owner": "string", "exp": 0, "grant": { "scope": [ "string" ], "allowSubscribe": [ "string" ], "allowPublish": [ "string" ], "dmHistory": "own" }}See the HTTP interface overview for authentication and access requirements.
Complete HTTP contract
Endpoint
POST /exchangeNo loopback capability on this listener. Fresh pinned-issuer/audience IdP proof or managed ledger actor secret authorizes the selected actor. A successful human exchange includes the current grant the issuer authorized; a managed-agent exchange keeps the token, owner and exp response. Public views are channel-writer, channel-purger, manager-caller, session-caller and transfer-writer; other views return 403. ttlSec is constrained by issuer policy and proof expiry; agent bearer cap is 300 seconds. Invalid proof or manager selection returns 401. Refused proof/view attempts share the public peer budget; successful credentials still mint when the budget is full. Origin is refused.
Parameters
No operation parameters.
Request body
UTF-8 JSON; maximum 65536 bytes. An Authorization header does not replace the JSON proof.
Required: yes.
Content type: application/json.
{
"$ref": "#/components/schemas/ExchangeRequest"
}Example: Human identity
Replace the placeholder with a fresh proof from the configured identity provider.
{
"actor": "worker",
"idpToken": "<idp-token>"
}Example: Managed agent
Replace the owner and secret with the managed agent grant.
{
"owner": "<owner>",
"actor": "worker",
"actorToken": "<managed-agent-secret>",
"view": "manager-caller"
}Responses
HTTP 200
Successful response.
Content type: application/json.
{
"$ref": "#/components/schemas/Bearer"
}HTTP 400
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 401
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 403
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 405
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 413
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 415
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 429
JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}HTTP 500
Server failure. An unexpected failure reaching the listener boundary returns only {"error":"internal server error"}; details are logged server-side. A route's named server failure may include its error code and outcome.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}Example:
{
"error": "internal server error"
}HTTP 503
Public admission cap (64 in flight), 10 second request deadline, or a route-specific unavailable read/effect. A service authority 503 may follow a binding; retain the request identity.
Content type: application/json.
{
"$ref": "#/components/schemas/Error"
}Authentication and access: HTTP interface of the stock auth public listener: 11 paths and 12 operations. Public means reachable through the configured listener, not unauthenticated. This implementation surface uses Cotal native contracts and does not establish a stable cloud API. Description version 1.0.0 identifies this document, not the wire or npm package version.
Credentials are JSON body proofs, with no loopback capability required. No CORS headers are sent. All POST routes and service authority GET reject any Origin header. Health, JWKS and mesh discovery GET permit Origin headers.
The listener binds 127.0.0.1; an operator HTTPS proxy supplies the external origin. Service endpoint routes require service endpoints enabled. Route lookup uses the exact request target: query strings and trailing slashes do not match and return JSON 404. Unknown paths and loopback-only lifecycle, enrollment verification, human-proof and consent routes return JSON 404. Configuration and route-specific native parser checks remain authoritative.
POST JSON bodies default to 65536 bytes; service authority accepts 2097152 bytes. Public work has 64 concurrent admissions and a 10000 ms deadline. Its separate rolling 30-refusal/minute peer budget is bounded to 1024 peer entries. Failure accounting is route-specific. Manager dispatch failures and chat native or store failures can consume the budget after valid proof verification. Otherwise successful requests are still evaluated when the refusal budget is full. Peer is socket address unless trusted proxy mode selects the last X-Forwarded-For hop.
OpenAPI specification contains the referenced response schemas. Complete Markdown reference.