Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Mint token on a lease
Mints a lease token for the data plane, bound to the current generation.
Mints a lease token for the data plane, bound to the current generation. Hand it to a process that must not hold the Access key.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:mintToken - Scope
sandboxes:exec - Effect
write— a successful call changes state. - Collection leases
#Request
| Field | Type | What it is |
|---|---|---|
name | string | The name of the lease. Required. |
scopes | TokenScope[] | What the token admits. Required. One of guest, ports, cdp, computer. |
ttl | duration | At most 1 hour and never past the lease's expire_time. |
#Response
| Field | Type | What it is |
|---|---|---|
token | string | The lease token; sent as a bearer token to the data plane. Never returned again. |
generation | int64 | The lease generation the token is bound to. |
expire_time | timestamp | When the token stops verifying. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_STATE— The Resource is in a state that forbids the call.IDEMPOTENCY_KEY_REUSED— An Idempotency-Key was reused with another body.IDEMPOTENCY_IN_PROGRESS— The first call with this Idempotency-Key is still running.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:mintToken" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scopes":["guest"]}'