---
title: "Create access and refresh tokens"
method: POST
path: "/auth/token"
tags: ["auth"]
---

# Create access and refresh tokens

`POST /auth/token`

Create and return new access and refresh tokens for a user based on their email and password.

## Query parameters

- `email` string, email, required
- `password` string, password, required

## Response `200`

Access and refresh tokens created successfully.

- AuthSchema
  - `access_token_data` TokenSchema, required
    - `token` string, required
    - `expires` string, date-time, required
  - `refresh_token_data` TokenSchema, required
    - `token` string, required
    - `expires` string, date-time, required
  - `user_id` integer, required
  - `company_id` integer, nullable
  - `customer_name` string, nullable

## Other responses

- `401` — Token creation failed because credentials are invalid.
- `422` — Request validation error.

---

[API](https://skmtc.dev/genlogs/apis/auth-api-create-token.md) · [All operations](https://skmtc.dev/genlogs/apis/auth-api-create-token/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/genlogs/auth-api-create-token/revisions/bf34c2431a21/schema)
