---
title: "Generate token"
method: POST
path: "/3rdparty/v1/auth/token"
tags: ["User", "Auth"]
---

# Generate token

`POST /3rdparty/v1/auth/token`

Generate new access token with specified scopes and ttl

## Request body

- SmsgatewayTokenRequest
  - `scopes` SmsgatewayJWTScope[], required — scopes for which the access token is valid
  - `ttl` integer — lifetime of the access token in seconds

## Response `201`

Token

- SmsgatewayTokenResponse
  - `access_token` string — actual access token
  - `expires_at` string, date-time — time at which the access token is no longer valid
  - `id` string — unique identifier for the access token
  - `refresh_token` string — refresh token
  - `token_type` string — type of the access token

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal server error
- `501` — Not implemented

---

[API](https://skmtc.dev/sms-gate/apis/smsgate-api.md) · [All operations](https://skmtc.dev/sms-gate/apis/smsgate-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sms-gate/smsgate-api/revisions/56a6604029f1/schema)
