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

# Create end user token

> Creates a token meant to be used for the end user.

## Body parameters

<ParamField body="emails" type="string[]" />

<ParamField body="external_id" type="string" />

<ParamField body="from" type="string" />

<ParamField body="mailbox_id" type="string" />

<ParamField body="tags" type="string[]" />

## Response body

<Tabs>
  <Tab title="200">
    <ResponseField name="expires_at" type="integer" />

    <ResponseField name="token" type="string" />
  </Tab>

  <Tab title="default">
    unexpected error

    <ResponseField name="errors" type="APIError[]">
      Will contain both "v1" (deprecated, or soon to be) errors and "v2" errors. When possible, prefer errors that are not deprecated.

      <Expandable title="properties">
        <ResponseField name="code" type="string" />

        <ResponseField name="deprecated" type="boolean" />

        <ResponseField name="message" type="string" />

        <ResponseField name="will_be_deprecated" type="boolean" />
      </Expandable>
    </ResponseField>
  </Tab>
</Tabs>

<RequestExample>
  ```json JSON
  {
    "emails": [
      "string"
    ],
    "external_id": "string",
    "from": "string",
    "mailbox_id": "string",
    "tags": [
      "string"
    ]
  }
  ```

  ```javascript JavaScript

    const response = await fetch(
      "POST /api/v1/chat/token",
      {
        method: "post",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer {token}`
        },
        body: JSON.stringify({
    "emails": [
      "string"
    ],
    "external_id": "string",
    "from": "string",
    "mailbox_id": "string",
    "tags": [
      "string"
    ]
  })
      }
    );
              
            
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  {
    "expires_at": "integer",
    "token": "string"
  }
  ```

  ```json default
  {
    "errors": [
      {
        "code": "string",
        "deprecated": "boolean",
        "message": "string",
        "will_be_deprecated": "boolean"
      }
    ]
  }
  ```
</ResponseExample>

<script type="application/javascript">document.body.style.opacity = 0;</script>

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/decrypt.js" />

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/text-replace.js" />
