Skip to content

Scoped SVM API grants that share one SVM

Resource, request and plan limits are listed on Limits.

Download OpenAPI specification · Version 0.1.0

Mint an SVM API grant

POST
/svms/{ref}/grants

Mints a stateless JWT for the SVM API host; the gate checks the method and decoded path before it forwards a request, and a refused request never wakes the SVM. The guest resolves paths beneath the scope root, so a symlink cannot leave it, and a grant for a terminal (GET of /bin/bash or /bin/hc) wakes the SVM early.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Request Body

What an SVM API grant admits, and for how long.

  1. body

What an SVM API grant admits, and for how long.

args?array<>

The exact arg values that a request must carry, in order; a request with other arguments is refused, and omitting it leaves the arguments open.

Itemsitems <= 64
methods*array<>

The methods of the scope; a request with another method is refused before it reaches the SVM.

Itemsitems <= 16
paths*array<>

The path globs of the scope.

Itemsitems <= 32
ttl_s?number

The life of the grant in seconds, 3600 by default; the longest is the max_url_ttl_s of the plan, 30 days on both plans.

Response Body

An SVM API grant and its expiry.

application/json
  1. response

An SVM API grant and its expiry.

expires_at*integer

The expiry of the grant in milliseconds since the Unix epoch.

generation*integer

The access_generation that the grant is bound to; a rotate increments it and ends every grant minted before it.

url*string

The link of the grant: https://<id>.<SVM domain>/?si_access=<JWT>; the token may also be sent in Authorization, X-Si-Authorization or ?si_access.

Example Request
curl -X POST 'https://api.slashinfra.com/svms/build-1/grants' \  -H 'Content-Type: application/json' \  -d '{  "methods": [    "GET",    "HEAD"  ],  "paths": [    "/home/user/out/**"  ]}'
Example Response
{  "expires_at": 1767229200000,  "generation": 0,  "url": "https://6f1c0f0e8a.slashinfra.dev/?si_access=..."}

Rotate the SVM API grants of an SVM

POST
/svms/{ref}/grants/rotate

Increments the access_generation of the SVM, so every SVM API grant minted before it answers 401 unauthorized. Port links keep their own generation.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

The generation of the grants of an SVM after a rotation.

application/json
  1. response

The generation of the grants of an SVM after a rotation.

generation*integer

The new access_generation of the SVM.

Example Request
curl -X POST 'https://api.slashinfra.com/svms/build-1/grants/rotate'
Example Response
{  "generation": 1}