Skip to content

Create a credential invitation.

Request

Creates a pending invitation in the organization and environment selected by the authenticated service user and required headers.

The response contains the only current plaintext code. DeepCredentials does not email the code or return a redemption URL in the B2B flow. Your system owns code delivery and the recipient experience. Exchange the recipient's email and code through POST /api/v1/public/credential-invitations/redeem; where and how your system exposes that flow is up to you.

Only one pending invitation may exist for the same organization, environment, credential definition, and normalized email address. reference_id is correlation metadata only; it does not make this operation idempotent or unique.

Security
BearerAuth
Headers
X-Org-Idstring, (uuid)required

Organization the call is acting on. The authenticated service user must be a member of this organization in DeepAdmin; otherwise the request returns 404.

X-Environmentstringrequired

Environment the call is scoped to. Invitation resources are isolated per environment.

Enum:"beta""production"
Bodyapplication/jsonrequired
credential_definition_idstring, (uuid)required

Credential definition to issue after redemption. Configure it in the portal before making runtime B2B calls.

emailstring, (email), <= 255 charactersrequired

Recipient email used together with the code by the public redemption endpoint. It is trimmed and normalized to lowercase when stored. DeepCredentials does not email it in this B2B flow.

claimsobject, non-emptyrequired

Claim values for the eventual credential. Keys and JSON value types must match the credential definition, all mandatory claims must be present, and the serialized payload must not exceed 6 MB. Invitation responses do not return these values; retain them in your own durable request record when lost-response recovery matters.

reference_idstring

Optional correlation identifier from your system; echoed on the resource.

invitation_ttl_secondsinteger, (int64), >= 1required

Positive lifetime of the invitation code in seconds.

offer_validity_secondsinteger, (int64), >= 1

Optional positive lifetime, in seconds, of the credential offer created after redemption.

validity_secondsinteger, (int64), [ 60 .. 315360000 ]

Optional eventual credential lifetime in seconds. Omit to use the credential definition default. Allowed range is 60 seconds through 10 years. Invitation responses do not return this value; retain it in your own durable request record when lost-response recovery matters.

curl -i -X POST \
  https://docs.deepcredentials.swiss/_mock/docs/openapi/credential-invitations-v1/b2b/v1/credential-invitations \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Environment: beta' \
  -H 'X-Org-Id: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -d '{
    "credential_definition_id": "db167a9d-8182-430c-bff0-f9baa6d48bb6",
    "email": "alice@example.com",
    "claims": {
      "given_name": "Alice",
      "employee_number": "E-1042"
    },
    "reference_id": "partner-invitation-1042",
    "invitation_ttl_seconds": 86400,
    "offer_validity_seconds": 600,
    "validity_seconds": 31536000
  }'

Responses

Invitation created. The caller owns delivery of the returned code.

Bodyapplication/json
invitation_idstring, (uuid)required

Credential invitation ID.

environmentstringrequired

Environment selected by X-Environment when the invitation was created.

Enum:"beta""production"
credential_definition_idstring, (uuid)required

Credential definition used for the eventual offer.

credential_definition_namestringrequired

Credential definition name captured when the invitation was created.

emailstring, (email)required

Normalized recipient email required for public redemption.

code_last4string, = 4 characters^[0-9A-HJKMNP-TV-Z]{4}$required

Last four normalized code characters for support and delivery confirmation. This is not a redeemable code.

statusstring(CredentialInvitationStatus)required

Current invitation lifecycle state.

Enum:"pending""redeemed""expired""revoked"
reference_idstring

Optional correlation identifier from your system; echoed on the resource.

offer_validity_secondsinteger, (int64)

Configured lifetime of the offer created after redemption, when supplied at creation.

redeemed_offer_idstring, (uuid)

Offer created by a successful redemption. Present only after redemption.

expires_atstring, (date-time)required

Invitation-code expiry timestamp in RFC 3339 UTC.

redeemed_atstring, (date-time)

Successful redemption timestamp in RFC 3339 UTC.

revoked_atstring, (date-time)

Revocation timestamp in RFC 3339 UTC.

created_atstring, (date-time)required

Creation timestamp in RFC 3339 UTC.

codestring, = 11 characters^[0-9A-HJKMNP-TV-Z]{5}-[0-9A-HJKMNP-TV-Z]{5}$required

One-time plaintext invitation code. Returned only by create and rotate; the caller owns secure delivery.

Response
{ "invitation_id": "305ac8b8-299a-4e63-a969-405840e67772", "environment": "beta", "credential_definition_id": "db167a9d-8182-430c-bff0-f9baa6d48bb6", "credential_definition_name": "Employee Card", "email": "alice@example.com", "code_last4": "X7Q9", "status": "pending", "reference_id": "partner-invitation-1042", "offer_validity_seconds": 600, "expires_at": "2026-08-19T10:00:00Z", "created_at": "2026-08-18T10:00:00Z", "code": "7KMTD-5X7Q9" }