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.
| Header | Required | Description |
|---|---|---|
Seatify-Publishable-Key | Yes | The publishable key of the product. |
Two keys
Every endpoint except Ping sends two keys:
| Key | Where | Purpose |
|---|---|---|
| Publishable key | The Seatify-Publishable-Key header | It names the product that is calling. |
| License key | The key field of the request body | It 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
| Status | Message | Description |
|---|---|---|
| 401 | A publishable key is required. | The request has no Seatify-Publishable-Key header, or the header is empty. |
| 401 | The 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."
}