API Endpoint
POST /management/slugs
Create a new slug policy template for future license generation.
POST /management/slugs
Endpoint context
Use these endpoints from internal tooling or your frontend backend to inspect licenses, manage slug policy templates, provisioning API keys, webhook endpoint configuration/logs, and offline JWT signing keys. Management routes require the management bootstrap key configured via MANAGEMENT_API_KEYS or MANAGEMENT_API_KEY.
- Requires management API key auth.
- Slug names must be lowercase URL-safe (a-z, 0-9, hyphen).
- Expiration policy must be one of forever, duration, or fixed_date.
- offline_enabled defaults to false unless explicitly set.
- offline_token_lifetime_hours defaults to 24 unless explicitly set.
- attributes is an optional JSON object used for license information snapshots; defaults to {}.
curl -sS http://localhost:8080/management/slugs \
-H "Authorization: Bearer management_key_dev_123456" \
-H "Content-Type: application/json" \
-d '{
"name": "pro-monthly",
"max_activations": 3,
"expiration_type": "duration",
"expiration_days": 30,
"offline_enabled": true,
"offline_token_lifetime_hours": 24,
"attributes": {
"plan": "pro",
"features": ["analytics", "exports"]
}
}'
Request body
{
"name": "pro-monthly",
"max_activations": 3,
"expiration_type": "duration",
"expiration_days": 30,
"offline_enabled": true,
"offline_token_lifetime_hours": 24,
"attributes": {
"plan": "pro",
"features": ["analytics", "exports"]
}
}
Response body
{
"id": 2,
"name": "pro-monthly",
"max_activations": 3,
"expiration_type": "duration",
"expiration_days": 30,
"fixed_expires_at": null,
"offline_enabled": true,
"offline_token_lifetime_hours": 24,
"attributes": {
"plan": "pro",
"features": ["analytics", "exports"]
},
"is_default": false,
"created_at": "2026-04-21T12:00:00Z",
"updated_at": "2026-04-21T12:00:00Z"
}
Response field types
id
number
Stable internal slug id.
name
string
Lowercase URL-safe slug key used by /generate.
max_activations
number
Per-license seat limit for newly generated licenses.
expiration_type
"forever" | "duration" | "fixed_date"
Expiration policy mode.
expiration_days
number | null
Required when expiration_type is duration.
fixed_expires_at
string | null
RFC3339 timestamp required when expiration_type is fixed_date.
offline_enabled
boolean
Whether licenses under this slug can receive offline JWTs.
offline_token_lifetime_hours
number
Maximum lifetime for issued/refreshed offline JWTs, in hours.
attributes
object
JSON object snapshotted to generated licenses and embedded in offline JWT attributes claim.
is_default
boolean
True only for the default slug.
created_at
string
RFC3339 creation timestamp.
updated_at
string
RFC3339 update timestamp.
Error codes
400Invalid JSON, invalid slug name, invalid expiration policy fields, or invalid attributes shape.
401Missing or invalid management API key.
409Slug name already exists.
500Unexpected server or storage error.
Back to API overview