---
title: "createToken"
method: POST
path: "/tokens"
tags: ["tokens"]
---

# createToken

`POST /tokens`

This method provides the required authentication token to perform GBDS operations.

## Request body

- CreateTokenRequest
  - `data` object
    - `grantType` 'CREDENTIALS' | 'TOKEN' — How the token will be generated. To generate a new token from user credentials, use grantType = CREDENTIALS. To generate a new token using a currently valid token, use grantType = TOKEN.
    - `userName` string — User ID.
    - `userPassword` string — User password.
    - `token` string — Currently valid token to be used for the token renewal process.

## Response `201`

OK

- CreateTokenResponse
  - `data` object
    - `token` string — Currently valid token to be used for the token renewal process.
    - `expirationTime` integer — Expiration time of the token in milliseconds.
    - `ttl` integer — Token's time to live in milliseconds.

## Other responses

- `400` — Validation error, expired token, invalid credentials.
- `401` — Expired token, invalid credentials.
- `422` — Invalid token.
- `500` — Internal error, unknown token Error

---

[API](https://skmtc.net/griaule/apis/gbds-api.md) · [All operations](https://skmtc.net/griaule/apis/gbds-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/griaule/gbds-api/revisions/fa80f482ec5e/schema)
