Skip to content
Authentication

Authentication

Every request to the Management API sends an API key in the Authorization header as a Bearer token. An API key is a secret, and it never ships inside your application.

API keys

An API key belongs to one integration. Create the key on the integration in the dashboard. A request with the key can do what the scopes of the integration allow.

The dashboard shows the key only once, when you create it. Seatify cannot show the key again. Keep the key in a secret store, such as the secrets of your CI system. If the key is lost, create a new key and delete the old one.

HeaderRequiredDescription
AuthorizationYesThe word Bearer, a space and the API key.

The Management API does not accept a publishable key. A publishable key is for the License API.

Several keys

An integration can have more than one API key. For example, give each server or each CI system its own key. Every key of an integration has the same scopes and the same product.

Expiry and deletion

A key can have an expiry date. Choose the date when you create the key. The date cannot be changed later. After that date, the Management API answers every request with the key with the status 401. The expired key stays in the dashboard until you delete it.

To stop a key immediately, delete it. The Management API then answers every request with the key with the status 401. A deleted key gets the same answer as a key that never existed.

Rotate a key

  1. Create a second key on the same integration.
  2. Put the new key in your backend or CI job.
  3. Delete the old key.

Both keys work until you delete the old key. The integration keeps its scopes and its product.

Errors

StatusMessageDescription
401An API key is required.The request has no Authorization header, the header is empty, or the header does not use the Bearer scheme.
401The API key is not valid.No integration has this key. The key was deleted, or it has a typing error.
401The API key has expired.The expiry date of the key has passed.
403This integration does not have the licenses:write scope.The integration does not have the scope that the endpoint requires. The message names that scope.

The body has the error format of the Management API. See Errors.

WWW-Authenticate header

Every 401 and 403 answer has a WWW-Authenticate header. The header follows the Bearer token standard, RFC 6750.

StatusWWW-Authenticate
401, no API keyBearer
401, key not valid or expiredBearer error="invalid_token"
403Bearer error="insufficient_scope", scope="licenses:write"

In a 403 answer, scope names the scope that the endpoint requires.

Example

Check an API key with Get the current integration. The answer names the integration and its scopes.

curl https://api.seatify.dev/v1/me \
  -H "Authorization: Bearer $SEATIFY_API_KEY"

A valid key answers with the status 200:

{
  "org": {
    "id": "<org id>",
    "name": "Northwind Software"
  },
  "integration": {
    "id": "<integration id>",
    "name": "Zapier",
    "product_id": "<product id>"
  },
  "key": {
    "id": "<key id>",
    "name": "production",
    "expires_at": null
  },
  "scopes": [
    "policies:read",
    "licenses:read",
    "licenses:write",
    "customers:read",
    "customers:write"
  ]
}

A request without the header answers with the status 401:

{
  "message": "An API key is required."
}