> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Credential Code

> Part of the [Create Credential With Code flow](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow).

Creates a one-time-code that can then be used to create a new credential from a place you don't have access to one of your existing credential.



## OpenAPI

````yaml /openapi.yaml post /auth/credentials/code
openapi: 3.1.0
info:
  version: 1.807.0
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /auth/credentials/code:
    post:
      tags:
        - Auth
      summary: Create Credential Code
      description: >-
        Part of the [Create Credential With Code
        flow](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow).


        Creates a one-time-code that can then be used to create a new credential
        from a place you don't have access to one of your existing credential.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expiration:
                  anyOf:
                    - type: string
                      format: date-time
                    - type: integer
                      exclusiveMinimum: 0
                  description: >-
                    Code expiration, as an ISO-8601 datetime string or a unix
                    timestamp
              required:
                - expiration
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  expiration:
                    type: string
                required:
                  - code
                  - expiration
      security:
        - authenticationToken: []
          userActionSignature: []
components:
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)
    userActionSignature:
      type: apiKey
      in: header
      name: X-DFNS-USERACTION
      description: >-
        **User Action Signature:** Used to sign the change-inducing API
        requests.

        More details how to generate the token: [User Action Signing
        flows](https://docs.dfns.co/api-reference/auth/signing-flows)

````