---
title: "Obtain a JWT access token using username and password"
method: POST
path: "/api/token"
tags: ["Authentication"]
---

# Obtain a JWT access token using username and password

`POST /api/token`

**Response:**
Returns a JSON object with an access_token that expires in 30 days.

**Usage in Swagger:**
1. Call POST /api/token with your credentials
2. Copy the access_token from the response
3. Click "Authorize" in Swagger UI (at the top of the page)
4. Enter your JWT token (without "Bearer" prefix)

**Usage in regular requests:**
1. Call POST /api/token with your credentials
2. Copy the access_token from the response
3. Add the JWT token as an Authorization header as follows: 'Bearer <your_access_token>'

**Example:**
```bash
curl -X 'GET' \
'https://app.customily.com/api/Product/GetProductsCount' \
-H 'accept: application/octet-stream' \
-H 'Authorization: Bearer <your_access_token>'
```

## Response `200`

Successfully authenticated. Returns JWT access token.

- object
  - `access_token` string — JWT access token
  - `token_type` string — Token type (usually 'Bearer')
  - `expires_in` integer — Token expiration time in seconds (30 days = 2592000)

## Other responses

- `400` — Bad request - invalid credentials or missing parameters

---

[API](https://skmtc.dev/customily/apis/customily-design-studio-api.md) · [All operations](https://skmtc.dev/customily/apis/customily-design-studio-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/customily/customily-design-studio-api/revisions/01547a5f31d7/schema)
