# Create and manage API keys

Create a Ticketdesk AI API key for the REST API and the MCP server, make your first request, and revoke keys you no longer use.

Source: https://ticketdesk.ai/docs/api-keys
Updated: 2026-11-22

An API key lets your own code, a script or an AI tool such as Claude work with your Ticketdesk AI account. The same key works for the [REST API](https://ticketdesk.ai/docs/api) and the [MCP server](https://ticketdesk.ai/docs/mcp-server-automate-customer-support-with-ai/533).

## Create a key

1. Open Settings and select API Keys.
2. Click Create API Key.
3. Enter a Key Name that says where the key is used, such as "Production API" or "Claude MCP".
4. Click Create.

![Create API Key dialog](https://ticketdesk.ai/docs/images/api-keys-create.webp)

The new key appears in the list. Click the copy icon next to it and store it in your secret manager or environment variables, for example as `TICKETDESK_API_KEY`.

![API keys list](https://ticketdesk.ai/docs/images/api-keys.webp)

Create a separate key for each app or integration. If one leaks or you stop using an integration, you can revoke that key without breaking the others.

## Make a request

Send the key as a Bearer token in the `Authorization` header. The base URL is `https://api.ticketdesk.ai/v1`.

```bash
curl -X GET "https://api.ticketdesk.ai/v1/tickets" \
  -H "Authorization: Bearer $TICKETDESK_API_KEY"
```

The same request in JavaScript:

```js
const res = await fetch('https://api.ticketdesk.ai/v1/tickets', {
  headers: { Authorization: `Bearer ${process.env.TICKETDESK_API_KEY}` },
});
const tickets = await res.json();
```

A key acts on behalf of your account with full access, so use it only on servers and never in browser or mobile app code. Requests made with a key show up in the [audit logs](https://ticketdesk.ai/docs/audit-logs) like any other change.

Every endpoint, with request and response examples, is in the [API reference](https://ticketdesk.ai/docs/api). For AI agents, the [agent skill file](https://ticketdesk.ai/.well-known/agent-skills/SKILL.md) describes how to use the API step by step.

## Use the key with the MCP server

MCP clients such as Claude Desktop, Claude Code and Cursor connect to `https://api.ticketdesk.ai/mcp` with the key in the same header:

```json
{
  "mcpServers": {
    "ticketdesk": {
      "type": "http",
      "url": "https://api.ticketdesk.ai/mcp",
      "headers": { "Authorization": "Bearer <TICKETDESK_API_KEY>" }
    }
  }
}
```

See the [MCP server guide](https://ticketdesk.ai/docs/mcp-server-automate-customer-support-with-ai/533) for the available tools and example prompts.

## Revoke a key

Click Revoke next to the key. Requests with that key fail right away. Revoking can't be undone, so create the replacement key and update your app first if you're rotating keys.

API access is included in every paid plan, see [plans and billing](https://ticketdesk.ai/docs/billing).
