# Get started with the Control API

> Create a scoped API key, make a first read-only request with it, check the request log, and revoke the key when you are done.

The Control API can help you drive Buttons from your own scripts, show-control systems, or automation tools: using the same underlying capabilities the web interface uses, scoped to exactly what that integration needs and nothing more. This guide creates a scoped key, makes a first request with it, confirms it in the request log, and revokes it when you're done testing.

<callout color="yellow" title="Warning">
  Never embed a real API key in a script you share, commit to source control, or paste into a support request. Anyone holding the key has whatever access you granted it.
</callout>

## Before you begin

You need:

- Access to **Settings → API**.
- A resource you can safely make a harmless, read-only request against first.

## Create a scoped API key

1. Open **Settings → API**.
2. Select **Create API Key**.
3. Enter an **API key name**, such as `Broadcast Automation`, and an optional description.
4. Select **Next** to open **Set Permissions**.
5. Select only the specific permissions this integration actually needs: you can only grant permissions you already hold yourself, and you can change this later without creating a new key.
6. Select **Create**.

The key's actual value is shown exactly once, with a reminder that **this token will only be shown once**. Copy it now. Afterward, only its prefix stays visible for identification, not the full value.

## Make a first request

Use a read-only request first, so a mistake can't change anything:

```
GET /control/<domain>/v1/...
Authorization: Bearer <your key>
```

Replace `<domain>` with the area you're working with: for example, a request scoped to surfaces lives under `/control/surface/v1/...`. A missing, malformed, or revoked key returns **401 Unauthorized**. A valid key that lacks the permission for that request returns **403 Forbidden**.

The full request and response shapes are documented at `/control/docs`, generated directly from the running system rather than maintained by hand: check there for the exact endpoints, parameters, and schemas available to your version of Buttons.

## Inspect activity

Open **Settings → API** and select **API Docs**, or open the key's own detail view to see **Last used**. For a live view of requests as they happen, open the **Control API Requests** log: each entry shows the client address, method, path, and status code for every request made through the API, across all keys.

## Revoke the key

1. Open the key's detail view, or select it from the list.
2. Select **Revoke key** (or **Revoke** from a multi-select).
3. Confirm: revocation cannot be undone, and it takes effect immediately. Any request using this key afterward fails with **401 Unauthorized**, reported as the key having been revoked.

## If you get stuck

| What you see | What to try |
| --- | --- |
| Every request returns 401. | Confirm the `Authorization: Bearer <key>` header is present and the key hasn't been revoked. |
| A request returns 403, but other requests with the same key succeed. | The key is missing the permission for that request: open **Set Permissions** on the key and add only what the failing request needs. |
| You can't grant a permission you expected to be available. | You can only grant permissions your own account already holds: confirm your own access covers it first. |
| Requests start failing with 429. | You've hit the system-wide rate limit, see [Secure and monitor the Control API](/docs/buttons/v1.10/api/secure-and-monitor). |

## Where to go next

- [Secure and monitor the Control API](/docs/buttons/v1.10/api/secure-and-monitor), for permissions, rate limits, and responding to misuse.
- [Control API reference](/docs/buttons/v1.10/api/reference-guide), for the full endpoint list, schemas, and versioning policy.
- [Choose how another system operates Buttons](/docs/buttons/v1.10/integrations/external-control), if you're not sure the Control API is the right interface for what you're building.
