> ## Documentation Index
> Fetch the complete documentation index at: https://stage-docs.oktivo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Token

> Create a new API token. Returns the plaintext token exactly once.

## Request Body

**name** `string` *required*

A descriptive name for the token. Must be 1–128 characters.

**expiresInDays** `integer` *required*

Number of days until the token expires. Must be between 1 and 365.

## Response

**success** `boolean`

Indicates if the request was successful.

**data** `object`

**data properties**

**tokenId** `string`

Unique identifier for the token (used for deletion and rotation).

**name** `string`

The name you provided.

**prefix** `string`

The first 8 characters of the token (e.g., `okt_a1b2`). Used for identification without exposing the full value.

**plainToken** `string`

The full plaintext API token. **This is only returned once store it securely.**

**expiresAt** `string`

ISO 8601 timestamp of when the token expires.

```json 201 Created theme={null}
{
  "success": true,
  "data": {
    "tokenId": "tok_abc123def456",
    "name": "salesforce-integration",
    "prefix": "okt_a1b2",
    "plainToken": "okt_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
    "expiresAt": "2025-04-15T00:00:00.000Z"
  }
}
```

```json 400 Validation Error theme={null}
{
  "success": false,
  "message": "expiresInDays must be an integer between 1 and 365"
}
```

> [!NOTE]
>
> This endpoint requires **JWT authentication** (logged-in dashboard session). API tokens cannot create other API tokens.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.