# Initialize Token

## Initialize a new temporary token

<mark style="color:green;">`POST`</mark> `/initialize-token`

This endpoint creates a temporary token to authenticate the Taiki client CDK.

Your application should store the CLIENT\_ID for each unique client. On next sign in, Taiki can automatically retrieve user documents without sign in.

**Headers**

<table><thead><tr><th>Name</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>TAIKI-SECRET
</code></pre></td><td><pre><code>YOUR_SECRET_KEY
</code></pre></td><td>Your application's secret key</td></tr><tr><td><pre><code>TAIKI-USER-ID
</code></pre></td><td><pre><code>TAIKI_USER_ID
</code></pre></td><td>OPTIONAL: If provided, Taiki will use stored user credentials from last sign in. If not provided, Taiki will create a new one.</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="242">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>webhookURL</code></td><td>string</td><td>URL that Taiki servers will respond with document data</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": 1,
  "TEMPORARY_TOKEN": "0bcfa6cf-2f71-429a-96c3-7f46321e58ff",
  "TAIKI_USER_ID": "d71851db-74e4-46b6-a2b5-71bf3dcc25b9" // Empty if TAIKi_USER_ID is provided
}
```

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>id
</code></pre></td><td>int</td><td>unique ID </td></tr><tr><td><pre><code>TEMPORARY_TOKEN
</code></pre></td><td>string</td><td>Temporary token</td></tr><tr><td><pre><code>TAIKI_USER_ID
</code></pre></td><td>string</td><td>Taiki's internal user ID to associate the user to their credentials</td></tr></tbody></table>

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}
