Create credential code

Creates a one-time code that can be used to create a new credential from an environment where the client does not have access to any existing credentials. This endpoint is part of the Create Credential With Code flow.

HTTP request
POST /auth/credentials/code
Authorization requirements
Header Type Required Description
Authorization string Yes Bearer token used to authenticate the request. See Authentication flows for instructions on generating this token.
X-DFNS-USERACTION string Yes User action signature used to authorize change-inducing requests. See User Action Signing flows for instructions on generating this signature.
Request body
Field Type Required Description
expiration string (ISO 8601) or number (Unix timestamp) Yes The expiration time for the one-time code, provided as an ISO 8601 datetime string or a Unix timestamp.
ccurl --request POST \
  --url https://api.digitalassets.ibm.com/auth/credentials/code \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-DFNS-USERACTION: <api-key>' \
  --data '
{
  "expiration": "2023-11-07T05:31:56Z"
}
'
Response
200: Success

Example response:

{
  "code": "<string>",
  "expiration": "<string>"
}