# Authentication

## API Key

To authenticate your API requests, include your API key in the request header:

```
API-KEY: your_api_key
```

You can find your API key in your Alli dashboard under the Settings menu (General tab).

## User Identification

### User ID

Specify a user by including a user ID in the `OWN-USER-ID` header. This can be either:

* An existing user ID - identifies a previously created user
* A new user ID - Alli will automatically create a new user with this ID

All future API calls with the same `OWN-USER-ID` will be treated as coming from the same user.

### Email Information

You can associate an email address with a user by including it in the `USER-EMAIL` header.

### Non-ASCII Character Limitations

The `OWN-USER-ID` header cannot contain non-ASCII characters. If your user ID includes non-ASCII characters, encode it to base64 and use the format:

```
OWN-USER-ID: base64:CONVERTED_ID
```

User ID and email information can be viewed in the Customers section of your Alli dashboard.

Example Headers

```
OWN-USER-ID: 5f1234567a409876c082487
USER-EMAIL: user_1@email.com
```

## Agent Information

To make API calls using a specific agent's information, include the agent's email in the `AGENT-EMAIL` header. When you include a logged-in agent's email in the `AGENT-EMAIL` header, the API call will use that agent's information.

Example Headers

```
AGENT-EMAIL: agent_1@email.com
```


---

# Agent Instructions: 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:

```
GET https://docs.allganize.ai/api-reference/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
