> For the complete documentation index, see [llms.txt](https://integuru.gitbook.io/taiki-documentaion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integuru.gitbook.io/taiki-documentaion/detailed-references/initialize-token.md).

# 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://integuru.gitbook.io/taiki-documentaion/detailed-references/initialize-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
