---
title: "Create a new API token (email + password)"
method: POST
path: "/api/v1/tokens"
tags: ["Auth"]
---

# Create a new API token (email + password)

`POST /api/v1/tokens`

## Request

- Base URL: `https://getscaleforge.com`
- URL: `https://getscaleforge.com/api/v1/tokens`
- Auth: none required

Authenticates the user with Devise email/password and returns a freshly
issued raw API token. The raw token is returned ONCE; only its prefix
and metadata are retrievable afterwards.

## Request body

- object
  - `email` string, email, required
  - `password` string, password, required
  - `name` string
  - `scopes` string[]: Subset of UserApiToken::VALID_SCOPES

## Response `201`

Token issued

- object
  - `token` string: Raw token, shown only once
  - `id` integer
  - `name` string
  - `prefix` string
  - `scopes` string[]
  - `created_at` string, date-time

## Other responses

- `401`: Invalid email or password

---

[API](https://skmtc.dev/getscaleforge/apis/scaleforge-api.md) · [All operations](https://skmtc.dev/getscaleforge/apis/scaleforge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getscaleforge/apis/scaleforge-api/revisions/ca382e62f404?raw)
