# Claim a license

Claims a license for the current user and device.

`POST /v1/licenses/claim`

## Binding

The policy of the license decides what a claim binds. A claim can take a seat for the user, bind the device, or both. If the policy binds neither, the claim creates no binding.

A customer or a device is required only if the policy binds it. Seatify ignores a customer or a device that the policy does not bind. So your application can send both in every claim. See [Binding](../../../concepts/seats-and-devices/#binding).

## Authentication

Send the publishable key of the product. See [Authentication](../../authentication/).

## Request

| Header | Required | Description |
| --- | --- | --- |
| `Seatify-Publishable-Key` | Yes | The publishable key of the product. |
| `Content-Type` | Yes | Always `application/json`. |
| `Seatify-Nonce` | No | A new random value that the signature includes. See [Signed responses](../../#signed-responses). |
| `Seatify-Signing-Key` | No | The key ID of the signing key in your application. See [Signed responses](../../#signed-responses). |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | Yes | The license key. |
| `device` | object | No | The device. If the policy binds devices and the request has no device, the claim fails with the reason `device_required`. |
| `customer` | object | No | The person who uses the license. If the policy binds customers and the request has no customer, the claim fails with the reason `customer_required`. |

The `device` object has these fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `fingerprint` | string | Yes | A value that identifies the device. Send the same value in every request. The fingerprint is case-sensitive. See [Devices](../../../concepts/seats-and-devices/#devices). |
| `hostname` | string | No | The name of the device. The dashboard shows the device by this name. |

A `device` object with no values counts as a missing device.

The `customer` object has these fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `external_ref` | string | Yes | The customer reference. Use the user ID from your own system. The reference is case-sensitive. See [References](../../../concepts/customers/#references). |
| `email` | string | No | The email address of the person. |
| `first_name` | string | No | The first name of the person. |
| `last_name` | string | No | The last name of the person. |

Seatify writes the email address and the name only into empty properties of the customer. It never changes a value that is already set.

## Response

The answer is a [license check object](../#license-check-object).

If the policy binds devices, `device` holds the binding of the device. If the policy also requires heartbeats, `device.expires_at` is the end of the first lease. The answer does not show the seat.

## Reasons

A refused claim answers with the status 200 and a reason. It creates no seat and no device binding, and it does not activate the license.

| Reason | Description |
| --- | --- |
| `license_not_found` | No license has this key. Ask the user to check the key. |
| `product_mismatch` | The license belongs to another product. Ask the user to check the key. |
| `suspended` | The license is suspended. Tell the user. |
| `expired` | The license has expired. Tell the user. |
| `device_required` | The policy binds devices. Send the device. |
| `customer_required` | The policy binds customers. Send the customer. |
| `device_limit_reached` | All device slots are taken. The user must release another device first. |
| `seat_limit_reached` | All seats are taken. Tell the user. |

See [Refused answers](../#refused-answers).

## Errors

| Status | Reason | Description |
| --- | --- | --- |
| 400 | `The request body could not be read.` | The body is not valid JSON. |
| 400 | `The submitted details are not valid.` | A field is not valid. The `errors` field names it. See the table below. |
| 400 | `The signing key is not known.` | Your organization has no signing key with the ID in `Seatify-Signing-Key`. |
| 400 | `The nonce must be at most 255 characters.` | The value of `Seatify-Nonce` is too long. |
| 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. |
| 429 | `There are too many requests. Try again later.` | See [Rate limits](../../#rate-limits). |

These fields can be in `errors`:

| Field | Description |
| --- | --- |
| `key` | The license key is missing or too long. |
| `device.fingerprint` | The `device` object has no fingerprint, or the fingerprint is too long. |
| `device.hostname` | The hostname is too long. |
| `customer.external_ref` | The `customer` object has no reference, or the reference is too long. |
| `customer.email` | The email address is not valid or too long. |
| `customer.first_name` | The first name is too long. |
| `customer.last_name` | The last name is too long. |

See [Errors](../../#errors).

## Example

{{< tabs >}}
{{< tab name="curl" >}}
```bash
curl https://license.seatify.dev/v1/licenses/claim \
  -H "Seatify-Publishable-Key: $SEATIFY_PUBLISHABLE_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "key": "$LICENSE_KEY",
  "device": { "fingerprint": "$DEVICE_FINGERPRINT", "hostname": "studio-mac" },
  "customer": { "external_ref": "user-42", "email": "ada@example.com" }
}
EOF
```
{{< /tab >}}
{{< tab name="Swift" >}}
```swift
import Foundation

struct LicenseCheck: Decodable {
    let valid: Bool
    let status: String?
    let reason: String?
}

let body: [String: Any] = [
    "key": licenseKey,
    "device": ["fingerprint": fingerprint, "hostname": hostname],
    "customer": ["external_ref": userID, "email": email],
]

var request = URLRequest(url: URL(string: "https://license.seatify.dev/v1/licenses/claim")!)
request.httpMethod = "POST"
request.setValue(publishableKey, forHTTPHeaderField: "Seatify-Publishable-Key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONSerialization.data(withJSONObject: body)

let (data, _) = try await URLSession.shared.data(for: request)
let check = try JSONDecoder().decode(LicenseCheck.self, from: data)
```
{{< /tab >}}
{{< tab name="C#" >}}
```csharp
using System.Net.Http.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Seatify-Publishable-Key", publishableKey);

var response = await client.PostAsJsonAsync("https://license.seatify.dev/v1/licenses/claim", new
{
    key = licenseKey,
    device = new { fingerprint, hostname },
    customer = new { external_ref = userId, email },
});
var check = await response.Content.ReadFromJsonAsync<LicenseCheck>();

record LicenseCheck(bool Valid, string? Status, string? Reason);
```
{{< /tab >}}
{{< tab name="Go" >}}
```go
body, err := json.Marshal(map[string]any{
	"key":      licenseKey,
	"device":   map[string]string{"fingerprint": fingerprint, "hostname": hostname},
	"customer": map[string]string{"external_ref": userID, "email": email},
})
if err != nil {
	return err
}

req, err := http.NewRequest("POST", "https://license.seatify.dev/v1/licenses/claim", bytes.NewReader(body))
if err != nil {
	return err
}
req.Header.Set("Seatify-Publishable-Key", publishableKey)
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer res.Body.Close()

var check struct {
	Valid  bool    `json:"valid"`
	Status *string `json:"status"`
	Reason *string `json:"reason"`
}
err = json.NewDecoder(res.Body).Decode(&check)
```
{{< /tab >}}
{{< tab name="JavaScript" >}}
```javascript
const response = await fetch("https://license.seatify.dev/v1/licenses/claim", {
  method: "POST",
  headers: {
    "Seatify-Publishable-Key": publishableKey,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    key: licenseKey,
    device: { fingerprint, hostname },
    customer: { external_ref: userId, email },
  }),
});
const check = await response.json();
```
{{< /tab >}}
{{< /tabs >}}

```json
{
  "valid": true,
  "status": "active",
  "expired": false,
  "reason": null,
  "license": {
    "id": "<license id>",
    "name": "CIRRUS Team Floating Devices #0007",
    "expires_at": "2026-12-20T00:00:00Z",
    "activated_at": "2026-01-22T01:50:56Z"
  },
  "entitlements": [
    {
      "code": "API_ACCESS",
      "name": "API Access"
    },
    {
      "code": "AUDIT_LOG",
      "name": "Audit Log"
    },
    {
      "code": "CORE",
      "name": "Core"
    },
    {
      "code": "EXPORT_4K",
      "name": "4K Export"
    },
    {
      "code": "PRIORITY_SUPPORT",
      "name": "Priority Support"
    },
    {
      "code": "WHITE_LABEL",
      "name": "White Labelling"
    }
  ],
  "limits": {
    "max_devices": 50,
    "max_seats": 25,
    "max_processes": 4
  },
  "device": {
    "id": "<device binding id>",
    "expires_at": "2026-09-26T13:20:13Z"
  },
  "heartbeat": {
    "required": true,
    "interval_seconds": 3600,
    "grace_seconds": 1800
  },
  "process": null,
  "process_heartbeat": {
    "tracked": true,
    "interval_seconds": 300,
    "grace_seconds": 120
  }
}
```

