---
title: "Create a new API token in the application to use in the IoT Central public API. The token value will be returned in the response, and won't be returned again in subsequent requests."
method: PUT
path: "/apiTokens/{tokenId}"
---

# Create a new API token in the application to use in the IoT Central public API. The token value will be returned in the response, and won't be returned again in subsequent requests.

`PUT /apiTokens/{tokenId}`

## Path parameters

- `tokenId` string, required

## Query parameters

- `api-version` string, required

## Request body

- ApiToken — The permission definition.
  - `roles` RoleAssignment[], required — List of role assignments that specify the permissions to access the application.
    - `role` string, required — ID of the role for this role assignment.
    - `organization` string — ID of the organization for this role assignment.

## Response `200`

Success

- ApiToken — The permission definition.
  - `roles` RoleAssignment[], required — List of role assignments that specify the permissions to access the application.
    - `role` string, required — ID of the role for this role assignment.
    - `organization` string — ID of the organization for this role assignment.

## Other responses

- `default` — An error response received from the IoT Central Service.

---

[API](https://skmtc.net/azure/apis/iotcentral-iotcentral.md) · [All operations](https://skmtc.net/azure/apis/iotcentral-iotcentral/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/iotcentral-iotcentral/versions/565d8813cbd3/schema)
