---
title: "Create or renew your access tokens"
method: POST
path: "/token"
tags: ["Authentication"]
---

# Create or renew your access tokens

`POST /token`

Create or renew your access token.

:::info 
 If you need more info on tokens, check our [user guides](/docs/authorization/api-keys).
:::

## Request body

- union
  - union — Provide either an `api_key` **or** the trio `username`, `password`, and `organization_id`. Exactly one option must be supplied.
    - object
      - `api_key` string, required — The API key used to obtain your **new** `access_token` for the first time.
    - object
      - `username` string, required — Your username for authentication. > Include it in your request to **create** your `access_token`.
      - `password` string, password, required — Your password for authentication. > Include it in your request to **create** your `access_token`.
      - `organization_id` string, required — The unique identifier for your organization. > Include it in your request to **create** your `access_token`.
  - RenewToken
    - `refresh_token` string, required — The token obtained during the initial authentication using your API key. > Include it in your request to **renew** your `access_token`.
    - `organization_id` string, required — The unique identifier for your organization. > Include it in your request to **renew** your `access_token`.

## Response `200`

The operation was successful.

- AuthTokenResponse
  - `access_token` string, required — The short-lived Bearer token that you need to pass on API calls.
  - `refresh_token` string — A long-lived token that you can use to renew access tokens.
  - `organization_id` integer, required — The unique identifier for your organization.
  - `token_expires_at` integer — The timestamp when the access token expires, in milliseconds.

## Other responses

- `4XX` — Client error responses due to invalid input or missing parameters.
- `5XX` — Server error responses indicating an issue on the API side.

---

[API](https://skmtc.dev/nullplatform/apis/nullplatform-api.md) · [All operations](https://skmtc.dev/nullplatform/apis/nullplatform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nullplatform/nullplatform-api/revisions/1c4ea154b159/schema)
