---
search:
  tags:
    - Planned
    - POST
seo:
  description: >-
    Planned endpoint. This operation is declared in the public contract, but the
    current… Reference for the POST /v1/tokens endpoint in the Carton API
    reference.
sidebar:
  label: POST /v1/tokens
  badge: POST
title: POST /v1/tokens
type: openapi-operation
---
**Planned endpoint.** This operation is declared in the public contract,
but the current Carton server does not expose it.

`POST /v1/tokens`

**Request body** (`application/json`, required)

- `expires_at` (Timestamp)
- `name` (Text)
- `principal` (Text, required)
- `scopes` (TokenScope[], required)

Request body example:

```json
{
  "expires_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "principal": "string",
  "scopes": [
    "sandboxes:read"
  ]
}
```

**Responses**

- `201` — Success
- `400` — Typed error; Retry-After is present when retryable
- `401` — Typed error; Retry-After is present when retryable
- `403` — Typed error; Retry-After is present when retryable
- `409` — Idempotency request in progress, expired response, or conflicting state
- `413` — Request exceeds policy body limit
- `415` — Expected application/json
- `422` — Typed error; Retry-After is present when retryable
- `429` — Typed error; Retry-After is present when retryable
- `500` — Typed error; Retry-After is present when retryable
- `503` — Typed error; Retry-After is present when retryable

Response example, 201:

```json
{
  "token": {
    "created_at": "2019-08-24T14:15:22Z",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "name": "string",
    "principal": "string",
    "revoked_at": "2019-08-24T14:15:22Z",
    "scopes": [
      "sandboxes:read"
    ]
  },
  "value": "string"
}
```
