> For the complete documentation index, see [llms.txt](https://docs.userlane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.userlane.com/developers/authentication.md). Agents can also search and read this documentation through its [MCP server](https://docs.userlane.com/~gitbook/mcp).

# Authentication

The Userlane APIs authenticate requests with an API token. The same token works for the Core API and the Analytics API.

## Get your API token

1. Sign in to the Userlane Portal.
2. Open **Settings**, then the **Your profile** section, then **API Token**.
3. Copy the token.

Tokens are issued per Userlane Manager and can be regenerated at any time.

Treat the token like a password: keep it out of source code and client-side code, and store it in your secret manager. If it was exposed, regenerate it.

## Send the token

Send the token as it is in the `Authorization` header, with no prefix:

```
Authorization: YOUR_API_TOKEN
```

For example:

```bash
curl https://api.userlane.com/v3/applications/{application_id}/users \
  -H "Authorization: YOUR_API_TOKEN"
```

## Base URLs

| API           | Base URL                                            | Guides                                                                                                               |
| ------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Core API      | `https://api.userlane.com` (paths start with `/v3`) | [Getting started with Enduser data](https://docs.userlane.com/developers/core-api/getting-started-with-user-data.md) |
| Analytics API | `https://api.userlane.com/analytics`                | [Using the Analytics API](https://docs.userlane.com/developers/analytics-api/using-the-analytics-api.md)             |

The Subresource Integrity endpoint needs no token.

## Permissions

The token acts with the permissions of the Userlane Manager it belongs to. Some endpoints need more than read access: the Attribute import endpoints require a company admin or a portfolio owner, and reject other tokens with `403`.

## Errors

| Status             | What happened                                                      |
| ------------------ | ------------------------------------------------------------------ |
| `401 Unauthorized` | The token is missing, malformed, or no longer valid.               |
| `403 Forbidden`    | The token is valid, but its Userlane Manager lacks the permission. |


---

# 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.userlane.com/developers/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.
