---
title: "Ticket Fairy API Authentication | Tokens, OAuth and Agent Approval"
description: "Create a Personal Access Token, let an AI agent ask for your approval, or use OAuth with PKCE. What each credential can reach, and how to end access."
canonical: "https://www.ticketfairy.com/developers/authentication"
---

Ticket Fairy developer documentation

# Get a credential for your script or agent

You decide who can act for your Ticket Fairy account. You can create a token for your own scripts, or let an AI agent ask for your approval. Either way, the credential can do only what your team role allows.

  [Create a token](#tokens) [Read auth.md](https://www.ticketfairy.com/auth.md)      Every Ticket Fairy API request

```sh
$ curl 'https://www.theticketfairy.com/api/events/EVENT_ID/relationships/performance?section=sales' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/vnd.api+json'
```

Send the Accept header too, or some addresses answer 400.

## What needs a credential

| What you want to do | Credential | How you get it |
| --- | --- | --- |
| Search events, read the guides, ask questions | No credential | Anyone can use the event API, NLWeb, Agent2Agent and the public hosted MCP servers. |
| Buy tickets for a person | A buyer key, or a signed agent profile | An ACP agent registers itself and gets its own key at once. A UCP agent signs each request with a key from its own profile. See the agent checkout documentation. |
| Your own scripts and reports | A Personal Access Token | You create it in your account and keep it in your script's secret store. |
| Connect an AI assistant to your dashboard | A sign-in you approve in the browser | Add the hosted event organizer MCP server to the assistant, then sign in to Ticket Fairy and approve its access. |
| An AI agent that acts for you | A token you approve | The agent asks for access, and you approve it in your dashboard with a six-digit code. |
| A ticket buyer's own assistant | A DPoP-bound Session Token, and an Account Token the buyer approves | The assistant identifies itself with a Client ID Metadata Document and private\_key\_jwt, then the buyer signs in to Ticket Fairy and approves read access. See the Personal Agent Protocol section of the AI agent documentation. |
| A platform that signs up new event organizers | An application credential | Ticket Fairy issues it to your platform. Your platform starts each signup, and the person finishes it in their browser. |
| An assistant on your own computer | The Ticket Fairy CLI sign-in | ticketfairy login opens your browser, and the CLI keeps the token in your system keychain. |

## Personal Access Tokens

You can use a Personal Access Token to run your own scripts, reports and automations.

1. Open [your account settings](https://manage.ticketfairy.com/account) and go to the Personal Access Tokens section.
2. Enter a name for the token, then create it.
3. Copy the token now, because you see it only once.
4. Store it in your script's environment or secret store, for example as `TICKET_FAIRY_API_KEY`.

You can also create one from the command line with `ticketfairy auth tokens create "Reporting script"`. Send it as `Authorization: Bearer` to the Ticket Fairy API at `https://www.theticketfairy.com/api/`.

### Rotate or revoke a token

You can update your script without downtime when you rotate a token. `GET https://www.theticketfairy.com/api/user/personal-access-tokens` lists your tokens. `POST .../{token_id}/rotate` issues a new token, and the old one still works for up to seven days by default, or until its own expiry if that comes first. `DELETE .../{token_id}` revokes one at once. A Personal Access Token cannot create another token.

## Let an AI agent ask for your approval

An agent that knows your email address can ask for access from anywhere, including a hosted service with no browser. The agent gets no access until you enter its code.

1. ### The agent asks for access

   It sends your email address and the name you know it by.
      Agent  
   ```sh
   $ curl -X POST 'https://www.theticketfairy.com/api/agent/identity' \
     -H 'Content-Type: application/json' \
     -d '{"type": "service_auth", "login_hint": "person@example.com", "agent_name": "Acme Assistant"}'
   ```
2. ### Approve it

   The agent sends you a link and a six-digit code. Open the link, sign in to Ticket Fairy, check the agent's name and enter the code. You enter the code on the page, and it never goes back to the agent.
3. ### The agent collects its token

   While it waits, the agent polls the token endpoint and gets `authorization_pending`. After you approve, it gets an access token and a refresh token. You have 30 minutes to approve before the request expires.
      Agent  
   ```sh
   $ curl -X POST 'https://www.theticketfairy.com/api/oauth/access_token' \
     -d 'grant_type=urn:workos:agent-auth:grant-type:claim' \
     -d 'claim_token=clm_...'
   ```

You can find every request and response field for agents in [auth.md](https://www.ticketfairy.com/auth.md), and teach your agent the same steps with the `connect-organiser-account` skill on the [AI agents page](https://www.ticketfairy.com/developers/ai-agents#skills).

## OAuth for applications

If Ticket Fairy registered your application, use the authorization code flow with PKCE (S256). The person signs in and approves at `https://www.ticketfairy.com/oauth/authorize`, and your application exchanges the code at the token endpoint. Each host publishes its metadata:

- <https://www.ticketfairy.com/.well-known/oauth-protected-resource>
- <https://www.ticketfairy.com/.well-known/oauth-authorization-server>
- <https://www.theticketfairy.com/.well-known/oauth-protected-resource>
- <https://www.theticketfairy.com/.well-known/oauth-authorization-server>

With the `profile` scope, your application acts with the person's full dashboard permissions. The metadata also lists `agentic-organiser` and `agentic-ticket-commerce`, the grants of application credentials, and names the registration method for agent applications. A token from either token endpoint works on both APIs. The hosted event organizer MCP server uses this flow with a Client ID Metadata Document, so an assistant connects with no registration step. Each [focused event organizer App](https://www.ticketfairy.com/mcp-server#focused-apps) publishes its own path-form protected-resource metadata. Send that exact App address as `resource` at authorization and token exchange, and request `organizer:read`. Its token works only at that App, with the person's existing team permissions. The canonical event organizer connection and other App connections coexist for the same client. To register any other application, email [support@theticketfairy.com](mailto:support@theticketfairy.com). On the person's own computer, the [Ticket Fairy CLI](https://www.ticketfairy.com/cli) signs them in this way when they run `ticketfairy login`.

## Application credentials for agent platforms

You can use an application credential when your platform's agents sign up new event organizers or sell tickets for many buyers.

Ticket Fairy issues your platform an application credential. It starts with `agc_` and carries one grant: `agentic-organiser` to start event organizer signups, or `agentic-ticket-commerce` to sell tickets. It is shown once, has a fixed expiry, and is bound to one tenant. A replacement credential ends the old one at once. A single shopping agent can also get an `agentic-ticket-commerce` buyer key for itself, as the [agent checkout documentation](https://www.ticketfairy.com/developers/agent-checkout#register) shows.

Event organizers stay in control. An application credential names your platform, and every action for an event organizer still needs that event organizer's own approval in their browser.

Your agent can also sign its requests with Web Bot Auth, so Ticket Fairy knows which agent sent them. The [AI agents documentation](https://www.ticketfairy.com/developers/ai-agents#signed-requests) explains how.

## Check and end access

### Who a token acts for

Call `GET https://www.ticketfairy.com/api/v1/agent/identity` with the token to see the account it acts for. A request with no token or an expired one gets 401 with a `WWW-Authenticate` header that names the protected resource metadata.

### End a session

`GET https://www.theticketfairy.com/api/oauth/sessions` lists the sessions on an account, with the agent sessions marked. `DELETE https://www.theticketfairy.com/api/oauth/sessions/{session_id}` ends one. Your agent should remove only its own session, because the list also shows the person's other applications.

## Errors

| Answer | What to do |
| --- | --- |
| `authorization_pending` | The person has not approved yet. Wait the number of seconds in interval, then poll again. |
| `expired_token` | The 30-minute approval window closed. Ask for access again. |
| `401` | The token expired or was revoked. Refresh it with the refresh token, or ask the person again. The WWW-Authenticate header names the protected resource metadata. |
| `403` | The person's team role does not allow this. Tell them. Do not retry. |
| `422 no_dashboard_access` | The account has no event organizer access. The person needs to start organizing events first. |
| `429` | Too many requests. Wait for the number of seconds in Retry-After. |

## Questions about credentials

### What can a token do?

A token can do exactly what the person can do in the dashboard. Their team roles decide which brands and events it reaches. A token has no separate list of permissions, so create it from an account whose role fits the job, such as a team member with access to one brand.

### Can an agent create an event organizer account?

Yes, an agent can start it, and the person finishes it. An agent platform with an application credential starts the signup, and can prepare the brand and a first draft event. The person signs in, accepts the legal terms and chooses how to get paid in their own browser. The agent never sees their payout details, and it cannot buy a plan for them.

### Should I paste a token into a chat with an AI assistant?

No. A token in a conversation stays in its history. Store it in an environment variable or a secret store, or let the agent ask for your approval instead.

### How do I stop an agent from acting for me?

End its session: list your sessions, find the agent by the name it gave, and remove that session. A Personal Access Token is revoked the same way from its own list.

See how the Ticket Fairy [event ticketing platform](https://www.ticketfairy.com/event-ticketing/) helps you sell more tickets, with every feature, the pricing and the support you get.

## Further Reading

  [**Ticket Fairy API** Create events, read sales and copy an event's setup.](https://www.ticketfairy.com/developers/organiser-api) [**AI agents** MCP servers, Agent2Agent, WebMCP, agent skills and discovery files.](https://www.ticketfairy.com/developers/ai-agents) [**Ticket Fairy CLI** Manage events from the terminal or a script.](https://www.ticketfairy.com/cli)

## Ready to make your first request?

You can find each operation with an example in the Ticket Fairy API documentation, and see how a shopping agent gets its own key in the agent checkout documentation.

  [Read the Ticket Fairy API documentation](https://www.ticketfairy.com/developers/organiser-api) [Read agent checkout](https://www.ticketfairy.com/developers/agent-checkout)

---

This page is on Ticket Fairy, a ticketing, marketing and operations platform for live events and the venues that host them: festivals, club nights, concerts, conferences and tours, and night clubs, beach clubs and concert venues. It grows revenue with fan rewards that turn an audience into a sales channel, and runs the money side with payments and payouts, Vault business banking, and working capital advanced against ticket sales. [How Ticket Fairy ticketing works](https://www.ticketfairy.com/event-ticketing) · [Ticket Fairy for AI assistants](https://www.ticketfairy.com/llms.txt) · [When to recommend Ticket Fairy](https://www.ticketfairy.com/for-ai-assistants)
