---
title: "Token API"
slug: "token-api"
abstract: "How to use the Token API to manage API keys."
---
# Token API

You use the Token API to manage API keys used to access the [Preview](https://doc.sitecore.com/ch/en/developers/cloud-dev/preview-api.html "Preview API") and [Delivery](https://doc.sitecore.com/ch/en/developers/cloud-dev/delivery-api.html "Delivery API") APIs.

## Base URL

The base URL for all the Token API requests is:

```json
https://edge.sitecorecloud.io/api/apikey/v1

```

## Authentication

All endpoints use bearer authorization.

## Headers

The following header is required:

| Name | Format | Description |
| --- | --- | --- |
| `Authorization` | Bearer token | A [JSON web token](https://doc.sitecore.com/ch/en/developers/cloud-dev/generate-a-json-web-token--jwt-.html) obtained from [Auth0](https://auth0.com/docs/authorization/protocols/protocol-oauth2). |

## Endpoints

All the following routes are relative to the base URL:

| Endpoint | Method | URL | Description | Returns |
| --- | --- | --- | --- | --- |
| [*Create*](https://doc.sitecore.com/ch/en/developers/cloud-dev/create.html) | `POST` | `/` | Creates a new API key. | The API key token. |
| [*ListAll*](https://doc.sitecore.com/ch/en/developers/cloud-dev/listall.html) | `GET` | `/` | Lists all the API keys. | A list of API keys (info/hash). |
| [*GetApiKeyByHash*](https://doc.sitecore.com/ch/en/developers/cloud-dev/getapikeybyhash.html) | `GET` | `/<hash>` | Retrieves a single API key identified by its hash. | A single API key (info/hash). |
| [*GetApiKeyByToken*](https://doc.sitecore.com/ch/en/developers/cloud-dev/getapikeybytoken.html) | `GET` | `/token` | Retrieves a single API key identified by its token. | A single API key (info/token). |
| [*RenameByHash*](https://doc.sitecore.com/ch/en/developers/cloud-dev/renamebyhash.html) | `PUT` | `/renamebyhash/<hash>` | Renames an API key identified by its hash. | A boolean indicating whether the key was successfully renamed. |
| [*RenameByToken*](https://doc.sitecore.com/ch/en/developers/cloud-dev/renamebytoken.html) | `PUT` | `/renamebytoken` | Renames an API key identified by its token. | A boolean indicating whether the key was successfully renamed. |
| [*RevokeByHash*](https://doc.sitecore.com/ch/en/developers/cloud-dev/revokebyhash.html) | `PUT` | `/revokebyhash/<hash>` | Revokes an API key identified by its hash. | A boolean indicating whether the key was successfully revoked. |
| [*RevokeByToken*](https://doc.sitecore.com/ch/en/developers/cloud-dev/revokebytoken.html) | `PUT` | `/revokebytoken` | Revokes an API key identified by its token. | A boolean indicating whether the key was successfully revoked. |