# Create Credential Challenge With Code

`POST /auth/credentials/code/init`

Part of the flow [Create Credential With Code](/d/advanced-topics/authentication/credentials.md#create-credential-with-code-flow).

Creates a credential challenge using a one time code-time-code. This challenge must then be signed by the new credential, before finalizing the flow.

{% hint style="info" %}

* Request headers required. See [Request Headers](/d/advanced-topics/authentication/request-headers.md) for more information.
  {% endhint %}

## Required Permissions

None

## Request body

<table><thead><tr><th width="209">Property</th><th width="101.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>code</code> <mark style="color:red;">*</mark></td><td><code>String</code></td><td>The code gotten from the <a href="/pages/XCrWSrGuW5QQ7gNSB6xQ">Create Credential Code</a> endpoint</td></tr><tr><td><code>credentialKind</code><mark style="color:red;">*</mark></td><td><code>String</code></td><td>Kind of credential being registered (see <a href="/pages/4fhQFGtqUCvaTBpttMYF#credential-kinds">Credential Kind</a>)</td></tr></tbody></table>

```json
{
  "code": "A7U-KY6-9PT",
  "credentialKind": "Fido2"
}
```

## Response

Same as [Create Credential Challenge](/d/api-docs/authentication/credential-management/api-reference/createusercredentialchallenge.md) endpoint


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-legacy.dfns.co/d/api-docs/authentication/credential-management/api-reference/createusercredentialchallenge-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
