HYBRID-CHAINDEVELOPERS
DOCUMENTATIONv2
POST

Authentication

Begin authenticator enrollment

/api/v2/me/authenticator-enrollments
AUTHENTICATIONBearer token · security:writeAUTHORITATIVE OWNERidentity-access · identity-serviceCONTRACT AUTHORITYGenerated Rust OpenAPISTATUSSource ready · production listed

PURPOSE + BUSINESS CONTEXT

Create a bounded TOTP enrollment and return the enrollment secret once under no-store.

WHEN THIS CALL IS USEFUL

Begin TOTP setup only in a secure authenticated UI ready to render or import the returned secret immediately.

OUTCOME · Create or advance

What changes

Creates a ten-minute pending enrollment bound to the current account session; TOTP is not active until confirmation.

WHY IT MATTERS

  • Gives people and agents a contract-backed way to advance authenticator enrollment.
  • Makes credential and account-lifecycle transitions explicit while keeping passwords, authenticator secrets, recovery codes, refresh tokens, devices, sessions, and account state under separate controls.

ISOLATION + AUTHORITY

Tenant identity, profile, password, authenticator enrollment, recovery code, device, session, access token, refresh credential, step-up grant, and account-closure state remain distinct. Authentication proves only the admitted session and scopes; it grants no workspace role, wallet, payment, settlement, publisher, matching, or trading authority.

BEFORE YOU CALL

  • Authenticate at the documented boundary: bearer+scope.
  • Use the live OpenAPI schema as the authority for the exact request shape and response model.
  • Use one Idempotency-Key only for retries of the same byte-equivalent logical mutation.
  • Resolve the tenant, account lifecycle, client device, credential state, authenticator or recovery basis, and required step-up purpose for this security transition.

WHAT TO DO NEXT

  • Render or import the returned enrollment secret immediately in a secure no-store surface, then discard the response from application state and logs.
  • Confirm the enrollment with a current authenticator code before treating TOTP as active; preserve the same logical idempotency key only for an equivalent retry.

AGENT GUIDANCE

  • Use authenticator enrollment only for the purpose and lifecycle stage described by this operation; do not treat it as authority for an adjacent action.
  • Use the live OpenAPI schema as the authority for the exact request shape and response model.
  • Keep registration, activation, credential verification, session issuance, refresh rotation, authenticator enrollment, confirmation, recovery, revocation, and account closure as separate lifecycle transitions.
  • After a timeout or conflict, read authoritative state before deciding whether an equivalent retry is safe.
MACHINE CONTRACT

The exact deployed parameters, schemas, responses, security requirements, and Hybrid-Chain agent metadata are authoritative at this operation's production OpenAPI JSON Pointer. The readable tables below add integration guidance; the deployed OpenAPI controls if guidance and the machine contract ever differ.

Open the authoritative production contract

EXTENDED INTEGRATION GUIDANCE

Readable request and response reference

Examples illustrate integration intent; the referenced OpenAPI operation and component schemas define the executable shape.

PARAMETERS

Headers, path, query, and body

NAMELOCATIONPRESENCETYPE / RULES / PURPOSE
AuthorizationheaderRequired

Bearer tokenCredential containing the security:write scope.EXAMPLEBearer hc_live_…

Idempotency-KeyheaderRequired

ASCII string · 1–128Caller-generated key reused for every retry of the same logical mutation.EXAMPLElaunch-treasury-v1-001

Content-TypeheaderRequired

application/jsonSigned mutations accept canonical JSON only.EXAMPLEapplication/json

Content-DigestheaderRequired

RFC 9530 SHA-256 digestDigest of the exact transmitted body bytes.EXAMPLEsha-256=:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=:

Signature-InputheaderRequired

RFC 9421 signature parametersCovers @method, @path, content-digest, content-type, and idempotency-key; includes keyid, nonce, created, and expires.EXAMPLEsig1=("@method" "@path" "content-digest" "content-type" "idempotency-key");created=1786582800;expires=1786583100;nonce="01J…";keyid="machine-prod"

SignatureheaderRequired

Ed25519 HTTP Message SignatureSignature made by an active public key registered to the authenticated client.EXAMPLEsig1=:base64-signature:

labelbodyOptional

string · max 64Account-visible authenticator label; defaults to Hybrid-Chain.

issuerbodyOptional

string · max 64Issuer embedded in the otpauth URI; defaults to Hybrid-Chain.

REQUEST

JSON body example

{
  "label": "Primary authenticator",
  "issuer": "Hybrid-Chain"
}

STABLE ERROR CODES

Branch on the code, then follow the recovery action

These codes are published by the authoritative gateway contract for this endpoint. Treat message as safe diagnostic text; integrations should branch on code and HTTP status.

STATUSCODEMEANING
400invalid_jsonThe JSON body is malformed or fails the published identity-security schema.
400invalid_security_requestThe session, scope, public key, proof, or purpose-bound security request is invalid.
401invalid_credentialsThe bearer, client assertion, or proof-of-possession credential is invalid.
403step_up_requiredFresh purpose-bound authenticator verification or stronger authority is required.
404signing_key_not_foundThe requested signing-key or workload-client resource was not found.
409security_conflictThe requested identity-security transition conflicts with current state.
503identity_security_unavailableThe authoritative Identity security service is temporarily unavailable.

RESPONSES

Status and payload examples

201Ten-minute pending enrollment created.Mutation completed · JSON RESPONSE+
{
  "enrollment_id": "9b51ed4c9c8f4aec85d1bd5520e40557",
  "secret": "JBSWY3DPEHPK3PXP",
  "otpauth_uri": "otpauth://totp/Hybrid-Chain%3Aada%40example.com?secret=…&issuer=Hybrid-Chain&algorithm=SHA1&digits=6&period=30",
  "label": "Primary authenticator",
  "expires_in": 600
}
INTEGRATION DECISION
CALLER ACTION
Accept the returned representation or receipt, then render or import the returned enrollment secret immediately in a secure no-store surface, then discard the response from application state and logs.
RETRY SAFETY
Do not repeat a successful mutation merely to confirm it. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Persist returned identifiers, versions, commitments, and receipts. Refresh the relevant account, session, authenticator, client, key, or one-time transaction state; replace consumed or expired credentials instead of replaying them.
400The optional label or issuer is invalid.Request must change · JSON RESPONSE+
{
  "code": "invalid_security_request",
  "message": "The optional label or issuer is invalid."
}
INTEGRATION DECISIONinvalid_security_request
CALLER ACTION
Rebuild the request from the live OpenAPI operation and correct the rejected method, media type, header, parameter, or body field.
RETRY SAFETY
Do not retry the same invalid request. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Compare the submitted values with the documented constraints before another call. Refresh the relevant account, session, authenticator, client, key, or one-time transaction state; replace consumed or expired credentials instead of replaying them.
ESCALATE WHEN
Escalate when account or tenant binding, session revocation, authenticator state, key rotation, or one-time-token consumption cannot be reconciled securely.
401The bearer credential is invalid.Authentication required · JSON RESPONSE+
{
  "code": "invalid_credentials",
  "message": "The bearer credential is invalid."
}
INTEGRATION DECISIONinvalid_credentials
CALLER ACTION
Discard the rejected credential, complete the documented authentication or reassertion flow, and rebuild any request signature with fresh timestamps and nonces.
RETRY SAFETY
Retry only with a newly valid credential and fresh replay-protection values. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Assume the outcome is unknown only when the connection failed after transmission; otherwise authentication failed before domain work. Refresh the relevant account, session, authenticator, client, key, or one-time transaction state; replace consumed or expired credentials instead of replaying them.
ESCALATE WHEN
Escalate when account or tenant binding, session revocation, authenticator state, key rotation, or one-time-token consumption cannot be reconciled securely.
409An authenticator is already enabled.State reconciliation required · JSON RESPONSE+
{
  "code": "security_conflict",
  "message": "An authenticator is already enabled."
}
INTEGRATION DECISIONsecurity_conflict
CALLER ACTION
Stop the mutation sequence and fetch the latest authoritative resource, lifecycle state, version, ETag, reservation, or existing idempotency result.
RETRY SAFETY
Retry only after reconciling the conflict. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Refresh the relevant account, session, authenticator, client, key, or one-time transaction state; replace consumed or expired credentials instead of replaying them.
ESCALATE WHEN
Escalate when account or tenant binding, session revocation, authenticator state, key rotation, or one-time-token consumption cannot be reconciled securely.
503Identity or authenticator encryption is unavailable.Dependency unavailable or outcome uncertain · JSON RESPONSE+
{
  "code": "identity_security_unavailable",
  "message": "Identity or authenticator encryption is unavailable."
}
INTEGRATION DECISIONidentity_security_unavailable
CALLER ACTION
Preserve the exact request and treat the outcome as uncertain until authoritative state proves whether it committed.
RETRY SAFETY
Reconcile before retrying. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions. Use bounded backoff with jitter.
STATE RECONCILIATION
Refresh the relevant account, session, authenticator, client, key, or one-time transaction state; replace consumed or expired credentials instead of replaying them.
ESCALATE WHEN
Escalate when account or tenant binding, session revocation, authenticator state, key rotation, or one-time-token consumption cannot be reconciled securely.

OPERATIONAL NOTES

Security and lifecycle guarantees

  • The secret and otpauth URI are returned once under no-store. Keep them out of logs, prompts, screenshots, analytics, and shared caches.
  • TOTP is still disabled until confirmation succeeds in the same session within ten minutes.

UPGRADING FROM V1

Legacy calls replaced by this operation

If you maintain an older integration, use this map to find the V2 replacement. Do not translate the old request field-for-field: rebuild it from the V2 parameters and schemas above because identity, authorization, replay protection, and response semantics may have changed.

GET/api/v1/auth/new2facodeAUTH: Generate new 2FA Registration Code
DOCUMENTATION STATUS

This route is implemented in canonical gateway source and appears in the production OpenAPI snapshot observed 2026-09-11T06:35:11.572Z. Authentication, tenant, feature, venue, and market policy still apply.

Verify the exact production OpenAPI operation Return to the V2 directory