# Grants

Scoped SVM API grants that share one SVM

Source: https://slashinfra.com/docs/api-reference/control/grants
Last modified: 2026-11-30T16:36:19.000Z

Scoped SVM API grants that share one SVM

Resource, request and plan limits are listed on [Limits](https://slashinfra.com/docs/reference/limits).

[Download OpenAPI specification](https://slashinfra.com/docs/control.openapi.json) · Version 0.1.0

[POSTMint an SVM API grant](https://slashinfra.com/docs/api-reference/control/grants#postSvmsByRefGrants)[POSTRotate the SVM API grants of an SVM](https://slashinfra.com/docs/api-reference/control/grants#postSvmsByRefGrantsRotate)

### 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`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/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.

Length`1 <= 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.

- body

- 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.

Items`items <= 64`

`methods*`array<>

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

Items`items <= 16`

`paths*`array<>

The path globs of the scope.

Items`items <= 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`

- response

- 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 ResponseSchema

```
{  "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`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/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.

Length`1 <= 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`

- response

- 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 ResponseSchema

```
{  "generation": 1}
```

POST

/svms/{ref}/grants

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/**"
]
}'
```

```
{
"expires_at": 1767229200000,
"generation": 0,
"url": "https://6f1c0f0e8a.slashinfra.dev/?si_access=..."
}
```

POST

/svms/{ref}/grants/rotate

Example Request

```
curl -X POST 'https://api.slashinfra.com/svms/build-1/grants/rotate'
```

```
{
"generation": 1
}
```
