POST /token — Create a scoped API token
POST https://api.sandbox-gameye.gameye.net/token
Section titled “POST https://api.sandbox-gameye.gameye.net/token”Creates a new API token with a specified set of scopes and optional expiry. The calling token can only grant scopes it already holds — it cannot create a token with broader permissions than itself.
Requires the token:write scope on the calling token.
Request Body
Section titled “Request Body”| Field | Type | Required | Description | Example |
|---|---|---|---|---|
name | string | Yes | A human-readable name for this token. Must be unique within your account. | "match-server-token" |
scopes | array | Yes | The list of permission scopes to assign to the new token. | ["session:start", "session:read"] |
expires_after | string | No | How long until the token expires. Valid time units are m and h, e.g. "30m", "1h", "2h30m". Values under a minute are rounded up. Omit for a non-expiring token. | "2h" |
Available Scopes
Section titled “Available Scopes”| Scope | Description |
|---|---|
session:start | Start new game sessions |
session:read | List and describe sessions |
session:stop | Stop running sessions |
artifact:read | Download session artifacts |
logs:read | Stream session logs |
regions:read | List regions and check tag availability |
token:write | Create new tokens (delegation) |
application:read | List applications and registry tags |
application:write | Create and modify applications |
Code Examples
Section titled “Code Examples”curl -X POST 'https://api.sandbox-gameye.gameye.net/token' \--header 'Authorization: Bearer YOUR_TOKEN' \--header 'Content-Type: application/json' \--data '{ "name": "match-server-token", "scopes": ["session:start", "session:read"], "expires_after": "2h"}'const response = await fetch('https://api.sandbox-gameye.gameye.net/token', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ name: 'match-server-token', scopes: ['session:start', 'session:read'], expires_after: '2h', }),});const { token } = await response.json();import requests
response = requests.post( 'https://api.sandbox-gameye.gameye.net/token', headers={ 'Authorization': 'Bearer YOUR_TOKEN', 'Content-Type': 'application/json', }, json={ 'name': 'match-server-token', 'scopes': ['session:start', 'session:read'], 'expires_after': '2h', },)token = response.json()['token']Responses
Section titled “Responses”A new API token was successfully created.
| Field | Type | Required |
|---|---|---|
token | string | Yes |
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}Invalid request body, duration format, or scope name.
You are not authorized. Make sure your bearer token is correct.
The calling token does not hold one or more of the requested scopes and cannot delegate them.
A token with the given name already exists.
The request body exceeds 64 KiB.
Bad request. The given request has invalid syntax.