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

# Authentication API (Login API)

Tellius provides backend APIs that allow advanced custom development, full UI control, and tight integration into your applications. Before calling any secured Tellius API (such as Insights APIs or Search APIs), you must first authenticate and obtain a temporary access token.

### **Endpoint**

```perl
POST https://<your-tellius-domain>/api/auth/login
```

```bash
curl 'https://qa1.dev.tellius.com/api/auth/login' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'Referer: https://qa1.dev.tellius.com/login' \
  -H 'sec-ch-ua: "Google Chrome";v="135", "Not-A.Brand";v="8", "Chromium";v="135"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'csrf: 2rp6y9fqnek' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json' \
  --data-raw '{"username":"<your_username>","password":"<your_password>"}'
```

{% hint style="info" %}
Replace `<your_username>` and `<your_password>` with your Tellius login credentials. Make sure the `csrf` header is passed (usually found in the page source when you are logged into Tellius).
{% endhint %}

### **Request example**

```
{
  "username": "your_username",
  "password": "your_password"
}
```

### **Response example**

```
{
 "id": "ba8bbdae-561c-4fff-aba4-33d12941243c",
 "message": "Login successful",
 "token": "<your_token_here>"
}
```

### **Session-based vs Token-based Authentication**

When calling the Login API, you can optionally include a `"session": true` parameter in the request body.

Tellius server creates a session and manages authentication via cookies. This is recommended for browser-based apps where automatic cookie handling is preferred. No need to manually send `Authorization` header after login.

If omitted, by default, Tellius returns a JWT access token. Recommended for mobile apps, API integrations, where you must manually send the JWT in the `Authorization: Bearer <token>` header for each API call.


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.tellius.com/tellius-6.2/api/authentication-api-login-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
