---
title: "POST /token"
method: POST
path: "/token"
---

# POST /token

`POST /token`

## Request

- Base URL: `https://api.sandbox-gameye.gameye.net`
- URL: `https://api.sandbox-gameye.gameye.net/token`
- Auth: HTTP bearer

## Request body

- CreateTokenRequestBody
  - `name` string, required: The name of the token to be created.
  - `scopes` string[], required: The list of scopes that the token should be created with.
  - `expires_after` string: The time after which the token should expire. Valid time units are 'm' and 'h'. Values equal to less than a minute will be rounded up to a minute.

## Response `201`

A new API token has successfully been generated.

- TokenCreatedResponseBody
  - `token` string, required

## Other responses

- `400`: Invalid request body, duration, or scope.
- `401`: You are not authorized to perform this request.
- `403`: The caller cannot delegate one or more requested scopes.
- `409`: Name conflict.
- `413`: The request body exceeds 64 KiB.
- `422`: Bad request. This may imply that the given request has invalid syntax.

---

[API](https://skmtc.dev/gameye/apis/gameye-session-api-2.md) · [All operations](https://skmtc.dev/gameye/apis/gameye-session-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/gameye/apis/gameye-session-api-2/revisions/0a019bf29067?raw)
