> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.poly.ai/feedback

```json
{
  "path": "/secrets/api-keys",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# API keys

> Create and manage API keys for accessing PolyAI's external APIs.

<img src="https://mintcdn.com/polyai/XrMtC1rV8-sgJgHo/images/secrets/api-keys-overview.png?fit=max&auto=format&n=XrMtC1rV8-sgJgHo&q=85&s=6274a720218a02525d85365d20600256" alt="API keys page in Agent Studio" width="2358" height="1388" data-path="images/secrets/api-keys-overview.png" />

API keys control access to PolyAI's external APIs – including the [Agents API](/api-reference/agents/introduction), [Conversations API](/api-reference/conversations/introduction), [Handoff API](/api-reference/handoff/introduction), and [External Events API](/api-reference/external-events/introduction). Create and manage keys from the **API Keys** page in Agent Studio.

<Note>
  API keys require the [Conversations API v3](/api-reference/conversations/introduction). If you are using v1, [migrate to v3](/api-reference/conversations/migrate-v1-to-v3) first.
</Note>

## Creating an API key

1. Go to the **API Keys** tab on the workspace homepage in Agent Studio
2. Select **API key**
3. Configure the key:
   * **Name** – a label to identify this key
   * **Agents** – choose "All agents" or select specific agents (this cannot be changed after creation)
   * **Permissions** – select which APIs the key can access:

| Permission             | Grants access to                                                                                                |
| ---------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Conversations data** | [Conversations API](/api-reference/conversations/introduction) – retrieve conversation transcripts and metadata |
| **Handoff**            | [Handoff API](/api-reference/handoff/introduction) – read handoff details                                       |
| **External events**    | [External Events API](/api-reference/external-events/introduction) – send events to active conversations        |

4. Select **Create** to generate the key

<Warning>
  Copy your API key immediately after creation. The full key value is only shown once.
</Warning>

## Viewing and managing keys

Your API keys appear on the **API Keys** page. Each entry shows:

* Key name and scope (which agents it covers)
* Expiry date
* A masked key value with a copy button
* Edit and delete options

Keys are independent – modifying or deleting one does not affect others.

## Configuring metrics

Metrics control what data appears in API responses. Configure them separately from API keys:

1. Select **Configuration** at the top of the **API Keys** page

<img src="https://mintcdn.com/polyai/nBKbCaJOQ73ML1LV/images/secrets/api-keys-configuration-button.png?fit=max&auto=format&n=nBKbCaJOQ73ML1LV&q=85&s=934f91a7e48475147faa2ea8164a2c93" alt="Configuration button on the API Keys page" width="3016" height="480" data-path="images/secrets/api-keys-configuration-button.png" />

2. Enable the metrics you want available in API responses:
   * Response metrics (e.g., `CALL_IN_PROGRESS`, `CALL_COMPLETED`, `HANDOFF_REASON`, `HANDOFF_TO`)
   * Conversation transcript access

<img src="https://mintcdn.com/polyai/nBKbCaJOQ73ML1LV/images/secrets/api-keys-metrics-configuration.png?fit=max&auto=format&n=nBKbCaJOQ73ML1LV&q=85&s=ae20b28844019ef0eb0c87282c72dbf8" alt="Metrics configuration panel showing response metrics and conversation transcript options" width="3010" height="1314" data-path="images/secrets/api-keys-metrics-configuration.png" />

<Note>
  Metrics are configured at the **project level**, not per key. For data to appear in an API response, both conditions must be met: the API key must have the relevant permission **and** the project must have the metric enabled.
</Note>

## Using your API key

Include the API key in the `x-api-key` header of your requests:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X GET "https://api.poly.ai/v3/conversations" \
  -H "x-api-key: YOUR_API_KEY"
```

For detailed endpoint documentation, see the [API reference](/api-reference/introduction).

## Key lifecycle

* Keys have an **expiry date** set at creation time
* Expired keys stop working immediately
* You can delete keys at any time from the API Keys page
* There is no limit to the number of keys you can create

## Best practices

* Create separate keys for different integrations (e.g., one for your CRM, one for analytics)
* Use the most restrictive permissions needed for each integration
* Rotate keys periodically by creating a new key before deleting the old one
* Monitor key usage through your API response logs

## Related pages

<CardGroup cols={2}>
  <Card title="Conversations API" icon="messages" href="/api-reference/conversations/introduction">
    Retrieve conversation metadata and transcripts programmatically.
  </Card>

  <Card title="Handoff API" icon="right-left" href="/api-reference/handoff/introduction">
    Access handoff context and manage transitions.
  </Card>

  <Card title="Agents API" icon="square-terminal" href="/api-reference/agents/introduction">
    Programmatically configure agents, variants, and deployments.
  </Card>

  <Card title="External Events API" icon="bolt" href="/api-reference/external-events/introduction">
    Send events to active conversations.
  </Card>
</CardGroup>
