---
title: "Create an API key so your own tools can read your ticket sales | Ticket Fairy Guides"
description: "Give the command line, a script or an agent its own key to your ticket sales, choose how long it lasts, and take it back the moment you need to."
canonical: "https://www.ticketfairy.com/guides/create-an-api-key-for-your-own-app"
---

1. [Ticket Fairy](https://www.ticketfairy.com/)
2. [Guides](https://www.ticketfairy.com/guides)
3. Create an API key so your own tools can read your ticket sales

Developers and the API

# Create an API key so your own tools can read your ticket sales

With an API key, your own spreadsheet, dashboard or agent can read what you can read, and nobody has to share a dashboard password. If you run more than a handful of events, you can keep your ticket sales in the tools you already work in.

Takes:  7 minutes

[Watch the video: Create an API key so your own tools can read your ticket sales](https://d3lcdr963b5ubl.cloudfront.net/uploads/guides/video/create-an-api-key-for-your-own-app/ca43082ec5b643260b356d2f8ff7cbb390d305165e3a9e74e87c5d182807730b/a1de78e051210c7d/guide.mp4) · [English](https://www.ticketfairy.com/resources/captions/guides/guide-create-an-api-key-for-your-own-app-a1de78e05121.vtt)

***Watch how it's done** 2 min 38 s, with captions.*

- [Open your account settings](#step-1)
- [Name the token after the tool that will hold it](#step-2)
- [Choose how long it should last](#step-3)
- [Copy the token before you close the window](#step-4)
- [Generate the brand key for the event APIs](#step-5)

## Before you start

- You know which tool needs the access: a laptop, a server, a scheduled script or an agent. One token per tool lets you take access back from one of them without touching the others.
- You have somewhere safe to keep the token, such as your password manager or your build system's secret store. You see the token once, and never again.

1. ## Open your account settings
    [Play from here](#guide-video)
   Open your account settings and find **Personal Access Tokens**.

   **Note:** Tokens belong to your own account rather than to a brand, because a token has your permissions. A teammate who needs their own access creates their own.

   ![The Personal Access Tokens card listing tokens with their created, last used and expiry dates](https://www.ticketfairy.com/embeds/posters/marketing-developer-access--personal-access-tokens.png)    
   *The tokens on an account, with one part-way through a rotation.*
2. ## Name the token after the tool that will hold it
    [Play from here](#guide-video)
   Select **New Personal Access Token** and enter the tool's name in **Token name**.

   **Note:** Name it for the laptop, service or script rather than for the job, because the name is how you find the right row when you take access back.
3. ## Choose how long it should last
    [Play from here](#guide-video)
   Open **Set custom expiry** and pick a length that suits the tool.

   **Note:** A year is the default and the longest available. Pick an hour or seven days for a one-off script, because a short life limits what a leak costs you.
4. ## Copy the token before you close the window
    [Play from here](#guide-video)
   Select **Create token** and copy the value it shows you into your password manager.

   **Note:** You see the token only once. If you close the window without copying it, you'll need to revoke that token and create another.
5. ## Generate the brand key for the event APIs
    [Play from here](#guide-video)
   Find **API Key** on the same page and select **Generate API Key**.

   **Note:** This is the key the event APIs ask for, the referral leaderboard among them. Regenerating it stops every application using the old key until you update them.

   ![The API Key and Webhook API Key cards, each showing the key with a control to copy it and one to regenerate it](https://www.ticketfairy.com/embeds/posters/marketing-developer-access--api-keys.png)    
   *The two keys, once each has been generated.*

## Or have it done for you

Fai, your AI teammate, can check sales, update your event or change a ticket when you ask.

Fai can open the page where you manage tokens. You create one yourself, because only you see the token, and only once.

### In your dashboard, with Fai

```
Open my account settings so I can create an access token
```

## From your terminal

Install the CLI from [our CLI page](https://www.ticketfairy.com/cli), sign in with `ticketfairy auth login`, and choose the brand you are working on with `ticketfairy brand use <BRAND_ID>`. `ticketfairy brand list` and `ticketfairy event list` show the IDs the other commands use.

Create a token from the command line, or use one you created in the dashboard by setting it as TICKET\_FAIRY\_API\_KEY, then check which brands it can act for.

### Create a token; the CLI prints it once

```
ticketfairy auth tokens create "<TOKEN NAME>"
```

### Show the brands the token can act for

```
ticketfairy brand list
```

## Swap a token without any downtime

 [Play from here](#guide-video)

1. ### Rotate it instead of replacing it

   Select **Rotate** on the row and copy the new token.

   **Note:** Rotating creates a fresh token under the same name and leaves the old one working for a grace period. Update every script and service before that window ends.
2. ### Tell the two rows apart afterwards

   Look for the badge marking the older half of the rotation before you remove anything.

   **Note:** Both rows have the same name, so the badge is what stops you taking the fresh token out of service by mistake.

Fai can open the page. You rotate the token and copy the new one yourself, because only you see the new value, and only once.

### In your dashboard, with Fai

```
Open my account settings so I can rotate an access token
```

### From your terminal

Rotate a token from the command line, then use the new value.

#### Rotate a token; the CLI prints the new value once

```
ticketfairy auth tokens rotate <TOKEN_ID>
```

## Take access back

 [Play from here](#guide-video)

1. ### Revoke the token the moment it leaks

   Select **Revoke** on the row for the tool that is affected.

   **Note:** Revoking stops that token immediately and cannot be undone. The tool needs a new token before it works again.

Fai can open the page. Revoking a token is something you do yourself, because it stops a live integration the moment it happens.

### In your dashboard, with Fai

```
Open my account settings so I can revoke an access token
```

### From your terminal

List your tokens and revoke one from the command line.

#### List your tokens and their ids

```
ticketfairy auth tokens list
```

#### Revoke a token

```
ticketfairy auth tokens revoke <TOKEN_ID>
```

## Questions you might have

**Which one do I use for the command line?**

 A personal access token. The command line, your own scripts and your agents all sign in with one, and each inherits the permissions your dashboard account has.

**What is the API key for, then?**

 The event APIs, such as your referral leaderboard. It belongs to the account that generates it, so a tool meant to outlive one person needs a key from an account that stays on the team.

**Can a token do everything I can?**

 Within your permissions, yes. That is why one token per tool and a short expiry are worth the extra minute, and why revoking is instant and never rate limited.

**How many tokens can I create?**

 Ten an hour, counting rotations, and you cannot create a new one while fifty are already live. Waiting clears the hourly count; the fifty needs you to revoke one you have finished with. A rotation doesn't count towards the fifty, so you can have fifty-one until the old token's grace period ends.

**What if I close the window without copying the token?**

 Revoke that token and create another. The value is never shown again, so there is nothing to recover and nothing lost by starting over.

## Still have a question?

Book a demo and we will answer it on a call, on your kind of event. Or create your account and see it for yourself.

   [Book a demo](https://www.ticketfairy.com/event-ticketing/book-a-demo) [Create a free account](https://manage.ticketfairy.com/welcome)

No setup fees. No monthly fee. No credit card required.

## Related guides

- [More ways to use Ticket Fairy](https://www.ticketfairy.com/features/api-and-developers)
- [Get a webhook each time you take a ticket order](https://www.ticketfairy.com/guides/get-a-webhook-when-a-ticket-sells)
- [Sell tickets on your own website](https://www.ticketfairy.com/guides/sell-tickets-on-your-own-website)
- [Invite your team to your events and choose what each person can do](https://www.ticketfairy.com/guides/invite-your-team)
- [Secure the account that runs your events](https://www.ticketfairy.com/guides/secure-your-account)
- [Every Ticket Fairy guide](https://www.ticketfairy.com/guides)

## Do this on your own event

Create your account, build your event and follow the steps in your own dashboard. You do not need to book a sales call.

  [Create a free account](https://manage.ticketfairy.com/welcome) [Book a demo](https://www.ticketfairy.com/event-ticketing/book-a-demo)

## Sell tickets with Ticket Fairy

Start free with unlimited events and no monthly fee, and choose a paid plan when you need more.

- Set up your event in minutes
- Free events are free
- Fai, your AI teammate, is built in

 [Create a free account](https://manage.ticketfairy.com/welcome)

No setup fees. No monthly fee. No credit card required.

## See it on a call

Book a demo and we will show you how Ticket Fairy handles your kind of event.

 [Book a demo](https://www.ticketfairy.com/event-ticketing/book-a-demo) [More ways to use Ticket Fairy](https://www.ticketfairy.com/features/api-and-developers)

### Tips for selling more tickets

Practical advice from working event organizers, and every new guide as it is published.

We respect your privacy. Unsubscribe anytime.

---

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)
