---
title: "How do I create and use API tokens?"
description: "TL;DR: API tokens let you run playbooks and integrate with Ballet programmatically. Owners create tokens in Settings → API tokens. Use the token as a Bearer credential in API requests to trigger playbook runs and access workspace resources."
canonical_url: "https://docs.ballet.dev/articles/how-do-i-create-and-use-api-tokens-Wp34UyMlMH"
md_url: "https://docs.ballet.dev/articles/how-do-i-create-and-use-api-tokens-Wp34UyMlMH.md"
---
# How do I create and use API tokens?

**TL;DR:** API tokens let you run playbooks and integrate with Ballet programmatically. Owners create tokens in **Settings → API tokens**. Use the token as a Bearer credential in API requests to trigger playbook runs and access workspace resources.

## Who this is for

Owners and Builders integrating Ballet with external systems, CI/CD, or custom apps.

## How do I create a token?


1. Go to **Settings → API tokens**.
2. Click **Create token**.
3. Name the token (e.g. "CI pipeline" or "Webhook handler").
4. Copy the token value — it is shown once.

Only **Owners** can create new tokens. Builders can view tokens they created.

## How do I use a token?

Include the token as a Bearer credential in HTTP requests to the Ballet API:

```Python
Authorization: Bearer <your-token>
```

Use tokens to trigger playbook runs, poll run status, and integrate Ballet into external workflows.

## How do I revoke a token?

Delete the token from **Settings → API tokens**. Revoked tokens stop working immediately.

## Security best practices

* Create separate tokens per integration — don't reuse one token everywhere.
* Store tokens as secrets, not in source code.
* Revoke tokens when an integration is decommissioned.

## Related articles

* [What are the roles and permissions?](/articles/what-are-the-roles-and-permissions-ownerbuildermember-2BqHtHiDcq)
* [What triggers can start a playbook?](/articles/what-triggers-can-start-a-playbook-manual-schedule-webhook-P4mdwPZDGg)
* [How do I store credentials with Secrets?](/articles/how-do-i-store-credentials-with-secrets-1D8OUcCo0n)
