> For the complete documentation index, see [llms.txt](https://tbns.gitbook.io/tbns/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tbns.gitbook.io/tbns/references/get-auth-token.md).

# Get Auth Token

### Authentication

Before using any other endpoints, you must obtain an authentication token by logging in with your credentials.

#### Login

**Endpoint**

```
POST /api/login
```

**Description**

Authenticate user and obtain access token for subsequent API calls.&#x20;

**Credentials**&#x20;

\- Email: \`Your email you use to login\` \
\- Password: \`Your PW\`&#x20;

If you want to test it only then use the credentials from the sandbox environment: <https://app.tbns.io/version-test/apply><br>

**Example Request**

```http
curl -X POST "https://api.tbns.io/functions/v1/api/login" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imh3a2htcWF2enphaWVvdmtvdHdiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDMwMDA3NDAsImV4cCI6MjA1ODU3Njc0MH0.nKjMLLZ7cY92nchtE2mFtBCOMqb0WWbiqkekaMqVFMU" \
-d '{"email": "test@company.com", "password": "test1234"}'
```

**Response**: Returns authentication token to be used in `X-Token` header for subsequent requests.

**Notes**

* The returned token must be used in all subsequent API requests
* Token expires after the specified duration in the response (expires field)
