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

# Authorization

### Method

<table><thead><tr><th width="321">Method</th><th>POST</th></tr></thead><tbody><tr><td>URL</td><td><code>/api/login</code></td></tr><tr><td>Content-Type</td><td>application/json</td></tr><tr><td>Body</td><td><code>{"login":"string","password":"string"}</code></td></tr></tbody></table>

Use this endpoint to get an authorization token for further API requests.

{% hint style="info" %}
The response returns an authorization token. The token expires in 3 hours.
{% endhint %}

### Request example

```json
{"login":"user@example.com","password":"strong-password"}
```

### Response example

```json
{"token":"b16b61fc-4706-4c90-a57d-fe0cd0dcd2f0"}
```

Use this token in the `Authorization` header as `Bearer {token}`.

### Response status codes

| Code | Description    |
| ---- | -------------- |
| 200  | Success        |
| 401  | Not authorized |
| 403  | Forbidden      |
