# Management API

Your backend, CI jobs and scripts call the Management API. The API manages your Seatify account from code.

## Base URL

```text
https://api.seatify.dev
```

## Versioning

Every path starts with `/v1`, such as `https://api.seatify.dev/v1/me`.

## Authentication

Every request sends an API key in the `Authorization` header as a Bearer token. An API key belongs to an [integration](integrations-and-scopes/). The scopes of the integration decide what the request is allowed to do. See [Authentication](authentication/).

An API key is a secret. Send it only from your backend, your CI jobs and your scripts. Never put it in your application.

## Errors

An error answer has this body:

```json
{
  "message": "The API key is not valid."
}
```

| Field | Type | Description |
| --- | --- | --- |
| `message` | string | A sentence that describes the error. |

Every endpoint can answer with these statuses:

| Status | Description |
| --- | --- |
| 401 | The API key is missing, not valid or expired. See [Authentication](authentication/#errors). |
| 429 | Your backend sent too many requests. See [Rate limits](#rate-limits). |
| 500 | An error happened in Seatify. Try again later. |

An endpoint that requires a scope can also answer with the status 403. The integration does not have that scope. See [Scopes](integrations-and-scopes/#scopes).

[Create a license](licenses/create-a-license/) can also answer with the status 402. Your account is at a limit of its plan. See [Plans and limits](../concepts/plans-and-limits/).

## Rate limits

The Management API limits the requests from one client address. It also limits the requests with one API key. Requests with a key that is not valid count too.

When your backend sends too many requests, the answer has the status 429 and this body:

```json
{
  "message": "There are too many requests. Try again later."
}
```

The `Retry-After` header gives the number of seconds to wait.

## Pagination

A list endpoint answers one page of items, the newest first. The answer has these fields next to the items:

| Field | Type | Description |
| --- | --- | --- |
| `total` | integer | The number of items that match the request. It is not the number of items on this page. |
| `next_cursor` | string or null | The cursor of the next page. It is `null` on the last page. |

To get the next page, send the value of `next_cursor` in the `cursor` query parameter. Send the same other query parameters with each page.

## Signatures

The Management API does not sign its answers.

