---
title: "Post a new API token for the user"
method: POST
path: "/api/v1/entities/users/{userId}/apiTokens"
tags: ["API tokens"]
---

# Post a new API token for the user

`POST /api/v1/entities/users/{userId}/apiTokens`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/entities/users/{userId}/apiTokens`
- Auth: none declared

## Path parameters

- `userId` string, required

## Request body

- JsonApiApiTokenInDocument
  - `data` JsonApiApiTokenIn, required: JSON:API representation of apiToken entity.
    - `id` string, required: API identifier of an object
    - `type` 'apiToken', required: Object type

## Response `201`

Request successfully processed

- JsonApiApiTokenOutDocument
  - `data` JsonApiApiTokenOut, required: JSON:API representation of apiToken entity.
    - `attributes` object
      - `bearerToken` string: The value of the Bearer token. It is only returned when the API token is created.
    - `id` string, required: API identifier of an object
    - `type` 'apiToken', required: Object type
  - `links` ObjectLinks
    - `self` string, uri, required: A string containing the link's URL.

---

[API](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/revisions/c728ef303bfb?raw)
