Skip to content
Authentication

Authentication

Every request to the License API sends a publishable key in the Seatify-Publishable-Key header. The publishable key tells the License API which product is calling.

Publishable keys

A publishable key belongs to one product. Create the key on the product in the dashboard. Put the key in the build configuration of your application.

A publishable key is not a secret. It ships inside your application, and anyone can read it.

HeaderRequiredDescription
Seatify-Publishable-KeyYesThe publishable key of the product.

Two keys

Every endpoint except Ping sends two keys:

KeyWherePurpose
Publishable keyThe Seatify-Publishable-Key headerIt names the product that is calling.
License keyThe key field of the request bodyIt proves the right to use the product.

The License API looks for the license only in the product that the publishable key names. A license of another product is not valid. The answer has the status 200 and the reason product_mismatch.

An unknown license key also answers with the status 200. The answer has the reason license_not_found. The status 401 always means that the publishable key is wrong. See Claim a license.

Retired and deleted keys

A product can have more than one publishable key. For example, you can give each platform or each build its own key. The activity log records which key made each request.

A retired key still works. Applications that already ship with it keep working. To stop a key from working, delete it. The License API then answers every request with that key with the status 401.

Errors

StatusMessageDescription
401A publishable key is required.The request has no Seatify-Publishable-Key header, or the header is empty.
401The publishable key is not valid.No product has this key. The key was deleted, or it has a typing error.

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

Unsigned answers

A 401 answer has no signature. It never grants access. Your application trusts only a 200 answer with a valid signature. See Verify signed responses.

Example

Check a publishable key with Ping. The answer names the product of the key.

curl https://license.seatify.dev/v1/ping \
  -H "Seatify-Publishable-Key: $SEATIFY_PUBLISHABLE_KEY"

A valid key answers with the status 200:

{
  "message": "pong",
  "api": "license",
  "product": {
    "id": "<product id>",
    "name": "Atlas Server",
    "code": "ATLAS"
  }
}

A request without the header answers with the status 401:

{
  "message": "A publishable key is required."
}