---
title: "Create a new token"
method: POST
path: "/api/token/"
tags: ["token"]
---

# Create a new token

`POST /api/token/`

## Request

- Base URL: `https://docs.blindinsight.io` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.blindinsight.io/api/token/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/blindinsight/apis/blind-insight-rest-api/docs/api/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new token for the user with the given email and password. On success,
returns a JSON web token which can be used in the `Authorization` header to make
API requests.

The response will be an JSON object with the access and refresh tokens.

**On the command line:**

```bash
blind token create --data '{"email": "demo@example.com", "password": "pass1234"}'
```

## Request body

- TokenObtainPair
  - `email` string, required
  - `password` string, required
  - `access` string, required
  - `refresh` string, required

## Response `200`

- TokenObtainPair
  - `email` string, required
  - `password` string, required
  - `access` string, required
  - `refresh` string, required

---

[API](https://skmtc.dev/blindinsight/apis/blind-insight-rest-api.md) - [All operations](https://skmtc.dev/blindinsight/apis/blind-insight-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blindinsight/apis/blind-insight-rest-api/revisions/0ac902401cea?raw)
