# Token API

Use the XM Cloud Content Token API to manage query tokens for the GraphQL Query API. By setting an expiration date and applying restrictions, such as making the token valid only for a particular IP address or publish state, you can control how content is queried. <br> <br> The <b>Try it</b> functionality available from the API documentation lets you explore API endpoints and make calls directly from the documentation.
## Authentication
To use this API, you need:

 - The URL of your XM Cloud Content server.
 - A JWT bearer token requested using the [OAuth Client Credentials flow](https://doc.sitecore.com/xmc/en/developers/xm-cloud/request-a-jwt-for-experience-edge.html). This is sent with every request.

{% admonition type="info" name="Note" %}The token must include a scope. Which scope to use depends on the endpoint being called. For mutation operations, such as `create`, `update`, and `delete`, include the `cs:all:admin` scope. To read existing tokens, include the `cs.all:editor` scope. {% /admonition %}


Version: v2.0
License: closed source

Metadata:
  - product: SitecoreAI Content

## Servers

```
https://cs-tokenapi.sitecorecloud.io
```

## Security

### Bearer

[object Object]

Type: http
Scheme: Bearer
Bearer Format: JWT

## Download OpenAPI description

 - [Token API](https://api-docs.sitecore.com/_bundle/sai/token-api/index.yaml)

## Token

 - [POST /api/token/v2](https://api-docs.sitecore.com/sai/token-api/token/createtoken.md): Creates a query token. The scope and permissions of the token are specified through the request TokenParameters object that includes a required label and expiration date and time (such as `"expiration
 - [GET /api/token/v2](https://api-docs.sitecore.com/sai/token-api/token/gettokens.md): Lists tokens for a specific tenant.
 - [GET /api/token/v2/{id}](https://api-docs.sitecore.com/sai/token-api/token/gettokenbyid.md): Retrieves a specific token using its ID.
 - [DELETE /api/token/v2/{id}](https://api-docs.sitecore.com/sai/token-api/token/deletetokenbyid.md): Deletes a specific token using its ID.
 - [PATCH /api/token/v2/{id}](https://api-docs.sitecore.com/sai/token-api/token/updatetokenbyid.md): Updates a specific token using its ID. When you update a token, you can omit properties that do not need to be updated. To remove a restriction, you can use null or an empty array. Changing the expira
 - [POST /api/token/v2/rotatekey](https://api-docs.sitecore.com/sai/token-api/token/rotatesigningkey.md): The signing key is used to digitally sign tokens and ensure their authenticity and integrity. Rotate the signing key to replace the current key with a new one that has updated security credentials. T
