HYBRID-CHAINDEVELOPERS
DOCUMENTATIONv2
POST

Identity · mobile

Register messaging device keys

/api/v2/identity/mobile/messaging/device
AUTHENTICATIONBearer token · trust:writeAUTHORITATIVE OWNERidentity-serviceCONTRACT AUTHORITYGenerated Rust OpenAPISTATUSSource ready · production listed

PURPOSE + BUSINESS CONTEXT

Bind one authenticated application installation to independently generated Ed25519 signing and X25519 encryption public keys after proof of possession, then return a signed device credential.

WHEN THIS CALL IS USEFUL

Use once per application installation after authentication and local generation of separate Ed25519 signing and X25519 encryption key pairs, before requesting a messaging ticket.

OUTCOME · Create or advance

What changes

Creates or idempotently confirms the active Identity-owned device-key binding and returns a signed 30-day device credential. It grants messaging identity only and never grants notification preference, business-state, payment, settlement, trading, ingress, publisher, market, or traffic authority.

WHY IT MATTERS

  • Gives people and agents a contract-backed way to advance messaging device keys.
  • Separates subject identity, consent, evidence, provider output, review, issuer credentials, and relying-party acceptance instead of collapsing them into a universal trust score.

ISOLATION + AUTHORITY

Bearer subject, tenant, purpose, policy version, role, issuer, reviewer, provider, and relying-party boundaries remain distinct. The response or transition grants no payment, custody, settlement, publisher, matching, or trading authority and must not expose regulated evidence beyond the live schema.

BEFORE YOU CALL

  • Authenticate at the documented boundary: bearer+scope.
  • Supply the required statement.deviceId (body), statement.encryptionPublicKey (body), statement.keyEpoch (body), statement.protocolVersion (body), statement.signingPublicKey (body), proofValue (body) exactly as defined by the live contract.
  • Use one Idempotency-Key only for retries of the same byte-equivalent logical mutation.
  • Resolve the applicable purpose, policy version, consent or role basis, and required assurance before relying on this result.

WHAT TO DO NEXT

  • Re-read messaging device keys using the canonical identifier returned by this operation.
  • Reconcile an ambiguous response with the same idempotency key before attempting another mutation.
  • Use the returned lifecycle state and policy version to choose the next least-privilege trust action; do not infer a missing stage.

AGENT GUIDANCE

  • Use messaging device keys only for the purpose and lifecycle stage described by this operation; do not treat it as authority for an adjacent action.
  • Supply the required statement.deviceId (body), statement.encryptionPublicKey (body), statement.keyEpoch (body), statement.protocolVersion (body), statement.signingPublicKey (body), proofValue (body) exactly as defined by the live contract.
  • Treat policy availability, consent, evidence capture, completed checks, review, decision, credential issuance, validity, and relying-party acceptance as separate facts.
  • 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 trust:write scope.EXAMPLEBearer hc_live_…

Idempotency-KeyheaderRequired

ASCII string · 1–128Caller-generated key reused for every retry of the same logical mutation.EXAMPLEmessaging-device-mobile-installation-01-epoch-1

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:

statement.deviceIdbodyRequired

safe device identifier · 8–128Stable application-installation identifier; it must match the device bound to the authenticated Identity session.EXAMPLEmobile-installation-01

statement.encryptionPublicKeybodyRequired

unpadded base64url X25519 public key · 43 charactersRaw 32-byte public encryption key. Keep its private key on the device.EXAMPLEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

statement.keyEpochbodyRequired

integer · 1–2147483647Monotonic public-key epoch bound into the signed device credential.EXAMPLE1

statement.protocolVersionbodyRequired

HybridSignedSealedEnvelope2026Exact signed-envelope protocol identifier.EXAMPLEHybridSignedSealedEnvelope2026

statement.signingPublicKeybodyRequired

unpadded base64url Ed25519 public key · 43 charactersRaw 32-byte public signing key used for envelope verification and proof of possession.EXAMPLEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

proofValuebodyRequired

unpadded base64url Ed25519 signature · 86 charactersProof over the exact domain-separated canonical statement.EXAMPLECCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

REQUEST

JSON body example

{
  "statement": {
    "deviceId": "mobile-installation-01",
    "encryptionPublicKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
    "keyEpoch": 1,
    "protocolVersion": "HybridSignedSealedEnvelope2026",
    "signingPublicKey": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
  },
  "proofValue": "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
}

RESPONSES

Status and payload examples

200Active device-key binding and signed W3C VC 2.0 device credential.Mutation completed · JSON RESPONSE+
{
  "protocol_version": "HybridSignedSealedEnvelope2026",
  "key_epoch": 1,
  "signing_key_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "encryption_key_sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "device_credential_sha256": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
  "device_credential": {
    "@context": [
      "https://www.w3.org/ns/credentials/v2"
    ],
    "type": [
      "VerifiableCredential",
      "HybridChainMessagingDeviceCredential"
    ],
    "issuer": "did:web:id.hybrid-chain.com",
    "credentialSubject": {
      "deviceId": "mobile-installation-01",
      "keyEpoch": 1
    }
  }
}
INTEGRATION DECISION
CALLER ACTION
Accept the returned representation or receipt, then re-read messaging device keys using the canonical identifier returned by this operation.
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 specific profile or account projection and compare tenant, profile, lifecycle, and version identifiers before retrying.
401The bearer credential is missing or invalid.Authentication required · JSON RESPONSE+
{
  "code": "invalid_credentials",
  "message": "The bearer credential is missing or 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 specific profile or account projection and compare tenant, profile, lifecycle, and version identifiers before retrying.
ESCALATE WHEN
Escalate when a fresh session resolves to an unexpected tenant or profile, or when an account lifecycle receipt cannot be found after reconciliation.
403The scope, session device, or Ed25519 proof of possession is invalid.Authority or policy denied · JSON RESPONSE+
{
  "code": "messaging_device_binding_forbidden",
  "message": "The scope, session device, or Ed25519 proof of possession is invalid."
}
INTEGRATION DECISIONmessaging_device_binding_forbidden
CALLER ACTION
Verify the exact scope, tenant or workspace membership, owner boundary, step-up purpose, feature policy, and resource eligibility. Never broaden authority automatically.
RETRY SAFETY
Do not retry until the missing authority or policy condition has been deliberately resolved with least privilege.
STATE RECONCILIATION
Confirm the caller and resource resolve to the same authority boundary for the authenticated profile, tenant brand, referral, funding, and account-lifecycle projections.
ESCALATE WHEN
Escalate when a fresh session resolves to an unexpected tenant or profile, or when an account lifecycle receipt cannot be found after reconciliation.
409This session already has a different active messaging identity.State reconciliation required · JSON RESPONSE+
{
  "code": "messaging_device_conflict",
  "message": "This session already has a different active messaging identity."
}
INTEGRATION DECISIONmessaging_device_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 specific profile or account projection and compare tenant, profile, lifecycle, and version identifiers before retrying.
ESCALATE WHEN
Escalate when a fresh session resolves to an unexpected tenant or profile, or when an account lifecycle receipt cannot be found after reconciliation.
422The protocol, device identifier, epoch, public keys, proof, or Idempotency-Key is malformed.Request must change · JSON RESPONSE+
{
  "code": "invalid_messaging_device",
  "message": "The protocol, device identifier, epoch, public keys, proof, or Idempotency-Key is malformed."
}
INTEGRATION DECISIONinvalid_messaging_device
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 specific profile or account projection and compare tenant, profile, lifecycle, and version identifiers before retrying.
ESCALATE WHEN
Escalate when a fresh session resolves to an unexpected tenant or profile, or when an account lifecycle receipt cannot be found after reconciliation.
503Authoritative Identity messaging registration is unavailable.Dependency unavailable or outcome uncertain · JSON RESPONSE+
{
  "code": "identity_messaging_unavailable",
  "message": "Authoritative Identity messaging registration is unavailable."
}
INTEGRATION DECISIONidentity_messaging_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 specific profile or account projection and compare tenant, profile, lifecycle, and version identifiers before retrying.
ESCALATE WHEN
Escalate when a fresh session resolves to an unexpected tenant or profile, or when an account lifecycle receipt cannot be found after reconciliation.

OPERATIONAL NOTES

Security and lifecycle guarantees

  • Generate separate Ed25519 signing and X25519 encryption key pairs on the device. Private keys never cross the gateway or Identity boundary and must not enter prompts, logs, analytics, crash reports, or shared storage.
  • To create proofValue, serialize statement as key-sorted compact JSON; prepend hybrid-chain/messaging/device-key-binding/v1 and one NUL byte; sign those exact UTF-8 bytes with the submitted Ed25519 private key.
  • Reuse the same Idempotency-Key only with the equivalent statement and proof. Identical active enrollment is retry-safe; a different active binding returns 409 and must be reconciled through its owner lifecycle, not bypassed with an invented epoch.
  • The signed device credential grants messaging identity only. It cannot send or acknowledge a notification and grants no business-state, payment, settlement, transfer, trading, matching, ingress, publisher, market-status, or traffic authority.
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