DOCS LLMs

Activate Device

Activate Device

Activates a device for a license, consuming one seat.

POST /api/v1/products/{slug}/licenses/{key}/activate

Try it in the Interactive API Docs →

When to Use

  • User first launches app on a new device
  • User enters a license key for the first time
  • After validating license, before enabling features

Path Parameters

Parameter Required Description
slug Yes Product slug (e.g., my-app)
key Yes License key to activate

Request Body

Parameter Required Description
device_id Yes Unique identifier for this device
device_name No Human-readable device name
metadata No Custom data (hostname, OS, etc.)

Example Request

curl -X POST https://licenseseat.com/api/v1/products/my-app/licenses/XXXX-XXXX-XXXX-XXXX/activate \
  -H "Authorization: Bearer pk_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "057b55c8-1234-5678-abcd-123456789abc",
    "device_name": "John'\''s MacBook Pro",
    "metadata": {"os": "macOS 14.0", "app_version": "1.2.0"}
  }'

Response

{
  "object": "activation",
  "id": 123,
  "device_id": "057b55c8-1234-5678-abcd-123456789abc",
  "device_name": "John's MacBook Pro",
  "activated_at": "2024-01-15T10:30:00Z",
  "ip_address": "192.168.1.1",
  "metadata": {
    "os": "macOS 14.0",
    "app_version": "1.2.0"
  },
  "license": {
    "object": "license",
    "key": "XXXX-XXXX-XXXX-XXXX",
    "status": "active",
    "active_seats": 1,
    "seat_limit": 3
  }
}

Response Fields

Field Description
id Unique activation ID
device_id The device ID provided
device_name Human-readable device name
activated_at Timestamp of activation
license Nested license summary with updated seat count

Already activated? Returns existing activation (200 OK, not error).

Error Responses

{
  "error": {
    "code": "seat_limit_exceeded",
    "message": "All seats are in use. Deactivate another device first.",
    "details": {
      "seat_limit": 3,
      "active_seats": 3
    }
  }
}

Error Codes

Code HTTP Meaning
license_not_found 404 License key doesn't exist
expired 422 License has expired
revoked 422 License has been revoked
seat_limit_exceeded 422 All seats are in use

Device ID Best Practices

The device_id should be:

  • Unique — Different for each device
  • Stable — Doesn't change across restarts or OS updates
  • Private — Not personally identifiable

Platform-Specific Approaches

Platform Recommended Source
macOS IOPlatformUUID via IOKit
Windows Win32_ComputerSystemProduct.UUID via WMI
Linux /etc/machine-id
iOS/Android Vendor identifier or identifierForVendor
Cross-platform SHA-256 hash of combined hardware identifiers

Typical Flow

1. User enters license key
2. Validate license (optional but recommended)
3. Generate device identifier
4. Call activate endpoint
5. Store activation locally (for offline grace periods)
6. Enable app features

See Also