# Create an API token

`POST https://api.parklio.com/v2/api-tokens`

Creates an API token for the account. Call it with a **Super Admin's user token** (from [Log in](/api/endpoints/auth-login)); API tokens can't create API tokens.

The `token` is returned **only in this response**: store it in your secret manager. Tokens don't expire; revoke one with [Delete an API token](/api/endpoints/api-token-remove).

An API token acts as the account's first Super Admin, and sees the lots that user is assigned to. See [Authentication](/api/authentication).

**Auth:** `Authorization: Bearer <token>`

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes |  |

```json
{
  "name": "dev laptop"
}
```

## Responses

### 200 — The new API token. `token` is only ever returned here; store it now.

```json
{
  "success": true,
  "data": {
    "id": 12,
    "name": "booking-backend",
    "account_id": 3,
    "token": "<your-api-token>",
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z"
  }
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

### 403 — User does not have permission to access requested resource.

```json
{
  "success": false,
  "errors": [
    {
      "code": 4,
      "message": "No permission."
    }
  ]
}
```

### 404 — Resource that has been requested does not exist. User should not try to repeat this request.

```json
{
  "success": false,
  "errors": [
    {
      "code": 6,
      "message": "Resource not found."
    }
  ]
}
```

### 422 — Some of the provided request parameters are missing or are invalid. User should add/change them according to response message.

```json
{
  "success": false,
  "errors": [
    {
      "code": 23,
      "message": "Validation error",
      "field": "field"
    }
  ]
}
```

