> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/inbox/inbox-api/authentication.md).

# Authentication

Every request carries a user token. Create a user for each service and get its token once.

Every request to the Inbox API is authorized with a user token, sent in the `Authorization` header:

```
Authorization: Token <token>
```

You create the user in the Inbox admin panel, request its token once, and send that token with every call.

{% hint style="warning" %}
Use a user token, not your channel's API key. The `D360-Api-Key` header from the WhatsApp API is not supported for Inbox API requests.
{% endhint %}

## Get a token

{% stepper %}
{% step %}
**Create a user in the admin panel**

Open the admin panel of your Inbox. Either:

* In the Inbox, open the menu (**⋮**) in the top right and select **Admin panel**, or
* Go to your Inbox URL followed by `/hub`, such as `https://your-stack.inbox.getchat.360dialog.io/hub`

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2FEGCYUTWa9QYS2e8HKuE9%2Fadmin-panel-menu.png?alt=media" alt="The Inbox menu, with Admin panel second from the bottom" width="294"><figcaption><p>Admin panel, in the Inbox menu</p></figcaption></figure>

Go to **Users** and select **Add user**. Fill in:

* **Username** — letters and digits only, such as `crmsync`. Pick a name your team will recognise: it shows as the sender of every message the service sends
* **Password** — a strong password. You need it once, in the next step
* **Groups** — add the **App integration** group

Save the user.
{% endstep %}

{% step %}
**Request its token**

Send the username and password to the token endpoint:

```bash
curl -X POST $INBOX/api/v1/auth/token/ \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "username=crmsync" \
  --data-urlencode "password=your-password"
```

The response contains the token:

```json
{"token": "8aeb44f5a318542d32bb13019d68198467ee21f0"}
```

Store it in your system's secrets. If you request it again for the same user, you get the same token back.

Reference: [Create auth token](/docs/inbox/inbox-api/api-ref/authorization.md#post-api-v1-auth-token)
{% endstep %}

{% step %}
**Use it in every request**

Send the token in the `Authorization` header, with the `Token` prefix:

```bash
curl -H "Authorization: Token $SERVICE_TOKEN" $INBOX/api/v1/users/current/
```

The call returns the user you created, so you can check which user your system acts as.

Reference: [Retrieve current user](/docs/inbox/inbox-api/api-ref/users.md#get-api-v1-users-current)
{% endstep %}
{% endstepper %}

## Why each service needs its own user

In the Inbox, a lot belongs to a **user**, not to the number:

* **Webhooks** are registered per user
* **New-message counts and received status** are tracked per user — a message your CRM has processed still counts as new for your bot
* **Permissions** — which chats a user can read and write — are set per user
* **Assignment** puts a chat on a user or a group
* **Audit logs** record which user did what

If several services share one user, they mark each other's messages as received, you cannot give them different permissions, and the audit log cannot tell them apart.

So give each service — your CRM sync, your bot, your data pipeline — its own user and its own token. People who work in the hosted Inbox sign in as themselves; never share a service's token with them.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.360dialog.com/docs/inbox/inbox-api/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
