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

# Authentication

> Authenticate with the Smart Send REST API using bearer tokens.

The Smart Send API uses bearer tokens for authentication. Every request must include a valid API token in the `Authorization` header.

## Creating an API token

To create an API token, start by logging into the <Link href="https://app.smartsend.io">Smart Send platform</Link> <Icon icon="arrow-up-right" size={12} />.

<Steps>
  <Step title="Navigate to API Tokens">
    Go to **<Link href="https://app.smartsend.io/api-tokens">API Tokens</Link>**.
  </Step>

  <Step title="Create token">
    In the **Create API Token** section, fill in a name. The name is only used for your internal classification and is not visible outside your team.

    <img src="https://mintcdn.com/smartsend/oG0vUhSrEWp3SfSv/images/api-tokens/sanctum-create.png?fit=max&auto=format&n=oG0vUhSrEWp3SfSv&q=85&s=d1c7df8960fd6ceabf8d67ecf6120e4e" alt="Create API Token form with token name field" className="rounded-lg" width="1440" height="900" data-path="images/api-tokens/sanctum-create.png" />
  </Step>

  <Step title="Generate token">
    Click the **Create** button. A modal opens displaying the newly generated API token.

    <img src="https://mintcdn.com/smartsend/oG0vUhSrEWp3SfSv/images/api-tokens/sanctum-created.png?fit=max&auto=format&n=oG0vUhSrEWp3SfSv&q=85&s=294eb5f668ff58b38c85a9c55df5d331" alt="Modal displaying the newly generated API token" className="rounded-lg" width="1440" height="900" data-path="images/api-tokens/sanctum-created.png" />
  </Step>
</Steps>

<Warning>
  The API token is only shown once. Copy it and store it somewhere safe immediately. If you lose it, you will need to delete it and create a new one.
</Warning>

## Using your API token

Include your API token in the `Authorization` header of every request, prefixed with `Bearer`:

```bash theme={null}
curl https://app.smartsend.io/api/v2/agents/dk \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
```

<Note>
  Treat API tokens like passwords. Never commit them to version control, embed them in client-side code, or share them in support tickets. Use environment variables or a secrets manager to keep them safe.
</Note>

## Revoking an API token

If a token is no longer needed or may have been exposed, revoke it immediately.

<Steps>
  <Step title="Navigate to API Tokens">
    Go to **<Link href="https://app.smartsend.io/api-tokens">API Tokens</Link>**.
  </Step>

  <Step title="Find the token">
    In the **Manage API Tokens** section, find the token you want to delete.

    <img src="https://mintcdn.com/smartsend/oG0vUhSrEWp3SfSv/images/api-tokens/sanctum-token-list.png?fit=max&auto=format&n=oG0vUhSrEWp3SfSv&q=85&s=c05daa558a0939d3a5495d1cdbd5593d" alt="List of API tokens with delete option" className="rounded-lg" width="1440" height="900" data-path="images/api-tokens/sanctum-token-list.png" />
  </Step>

  <Step title="Delete the token">
    Click the **Delete** button next to the token and confirm the action.

    <img src="https://mintcdn.com/smartsend/oG0vUhSrEWp3SfSv/images/api-tokens/sanctum-delete-confirmation.png?fit=max&auto=format&n=oG0vUhSrEWp3SfSv&q=85&s=27925081cb98111a0a4f2062691f7b6a" alt="Confirmation dialog for deleting an API token" className="rounded-lg" width="1440" height="900" data-path="images/api-tokens/sanctum-delete-confirmation.png" />
  </Step>
</Steps>

<Warning>
  Deleting an API token is irreversible and immediately breaks any integration that is still using it.
</Warning>
