Skip to content

Management API Documentation ​

Complete API for managing licenses and subscriptions programmatically.


Overview ​

The Management API allows you to:

  • License Management: create, retrieve, extend, delete, pause, and retrieve licenses
  • Subscription Management: Create, edit , and delete subscriptions
  • HWID Management: Configure hardware ID binding, resets, and restrictions
  • User Credentials: Manage licenses' username
  • Metadata: Store custom data with licenses (Discord IDs, emails, etc.)

Use this API to build your own license management system, automate bulk operations, or integrate licensing into your backend systems.


Authentication ​

All endpoints require an API key passed in the x-api-key header.

bash
curl -X POST https://api.keycrate.dev/license/create \
  -H "x-api-key: kc_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"app_id": "...", ...}'

API Key Format: Starts with kc_ (e.g., kc_abc123xyz)

Getting Your API Key: Generate one in your dashboard under Sidebar → API


Common Workflows ​

Create and Distribute 100 Trial Licenses ​

cURL:

bash
curl -X POST https://api.keycrate.dev/license/create-bulk \
  -H "x-api-key: kc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "key_amount": 100,
    "app_id": "your-app-id",
    "subscription_id": "trial-subscription-id",
    "duration_unit": "days",
    "duration_value": 7,
    "hwid_lock": true,
    "tags": ["trial", "batch-001"]
  }'

Python:

python
import requests

response = requests.post(
    'https://api.keycrate.dev/license/create-bulk',
    headers={'x-api-key': 'kc_your_api_key'},
    json={
        'key_amount': 100,
        'app_id': 'your-app-id',
        'subscription_id': 'trial-subscription-id',
        'duration_unit': 'days',
        'duration_value': 7,
        'hwid_lock': True,
        'tags': ['trial', 'batch-001']
    }
)
print(response.json())

Extend specific licenses ​

cURL:

bash
curl -X POST https://api.keycrate.dev/license/extend-bulk \
  -H "x-api-key: kc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "license_keys": ["key1", "key2", "key3"],
    "extend_seconds": 2592000
  }'

Python:

python
response = requests.post(
    'https://api.keycrate.dev/license/extend-bulk',
    headers={'x-api-key': 'kc_your_api_key'},
    json={
        'license_keys': ['key1', 'key2', 'key3'],
        'extend_seconds': 2592000
    }
)

Pause a licenses ​

cURL:

bash
curl -X POST https://api.keycrate.dev/license/update-status \
  -H "x-api-key: kc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "license_key": "key1",
    "status": "paused"
  }'

Python:

python
response = requests.post(
    'https://api.keycrate.dev/license/update-status',
    headers={'x-api-key': 'kc_your_api_key'},
    json={
        'license_key' : "key1",
        'status': 'paused'
    }
)

Get All Active Licenses for an App ​

cURL:

bash
curl -X POST https://api.keycrate.dev/license/get-bulk \
  -H "x-api-key: kc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "your-app-id",
    "status": "active",
    "per_page": 100,
    "sort_field": "created_at",
    "sort_order": "desc"
  }'

Python:

python
response = requests.post(
    'https://api.keycrate.dev/license/get-bulk',
    headers={'x-api-key': 'kc_your_api_key'},
    json={
        'app_id': 'your-app-id',
        'status': 'active',
        'per_page': 100,
        'sort_field': 'created_at',
        'sort_order': 'desc'
    }
)
licenses = response.json()['data']

Create a Subscription with Tier Levels ​

cURL:

bash
curl -X POST https://api.keycrate.dev/subscription/create \
  -H "x-api-key: kc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "your-app-id",
    "name": "premium",
    "level": 2,
    "single_key_per_hwid": true
  }'

Python:

python
response = requests.post(
    'https://api.keycrate.dev/subscription/create',
    headers={'x-api-key': 'kc_your_api_key'},
    json={
        'app_id': 'your-app-id',
        'name': 'premium',
        'level': 2,
        'single_key_per_hwid': True
    }
)

Error Handling ​

All errors follow this format:

json
{
    "error": "Human-readable error message",
    "error_code": "ERROR_CODE"
}

Common Error Codes:

CodeMeaningAction
MISSING_AUTHNo API key providedAdd x-api-key header
INVALID_API_KEYAPI key is invalid or inactiveCheck your API key
ACCESS_DENIEDYou don't have access to this appVerify app_id ownership
APP_NOT_FOUNDApp doesn't existCheck app_id
LICENSE_NOT_FOUNDLicense key doesn't existVerify license key
INVALID_INPUTRequest body has validation errorsCheck parameter types/values
SERVER_ERRORUnexpected server errorRetry after a delay

Rate Limiting ​

The rate limits are pretty generous for normal usage, If you hit rate limits, retry with exponential backoff (wait 1s, 4s, 10s, etc.).


Full API Reference ​

For complete endpoint documentation including all parameters, request/response schemas, and examples, see the OpenAPI Specification.

Key endpoints:

Licenses

  • POST /license/create - Create single license
  • POST /license/create-bulk - Create multiple licenses
  • POST /license/extend - Extend license duration
  • POST /license/extend-bulk - Extend multiple licenses
  • POST /license/delete - Delete license
  • POST /license/delete-bulk - Delete multiple licenses
  • POST /license/get - Get license details
  • POST /license/get-bulk - Query licenses with filters
  • POST /license/update-status - Pause/activate license
  • POST /license/update-status-bulk - Update multiple statuses
  • POST /license/update-subscription - Change license subscription
  • POST /license/update-user-credentials - Update username
  • POST /license/update-metadata - Update custom metadata

HWID Management

  • POST /hwid/edit - Set or clear HWID
  • POST /hwid/toggle-lock - Enable/disable HWID binding
  • POST /hwid/toggle-lock-bulk - Bulk HWID lock toggle
  • POST /hwid/toggle-reset-allowed - Allow/disallow HWID resets
  • POST /hwid/update-reset-interval - Set HWID reset cooldown

Subscriptions

  • POST /subscription/create - Create subscription tier
  • POST /subscription/edit - Update subscription properties
  • POST /subscription/delete - Delete subscription
  • POST /subscription/get-bulk - List all subscriptions

Best Practices ​

  1. Use Bulk Operations for actions on multiple licenses - create-bulk, extend-bulk, delete-bulk are more efficient
  2. Cache API Responses - Don't query the same license repeatedly
  3. Implement Retry Logic - Network errors happen, retry with backoff
  4. Validate Inputs - Check UUIDs and required fields before sending
  5. Store API Keys Securely - Never commit them to version control
  6. Use Metadata - Store user IDs, Discord IDs, emails in license metadata

Support ​

For issues or questions:

  • Check the error code first
  • Review the full endpoint documentation
  • Contact support with your request details and error response