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

# Introduction

> Authenticate requests and work with supported Phonely API resources.

> [!NOTE]
>
> This is the legacy Phonely API. It keeps working, but new integrations should use [API v1](https://docs.phonely.ai/api-reference/v1/overview.md). To move an existing integration, see [Migrate from the legacy API](https://docs.phonely.ai/api-reference/v1/migrate-from-legacy.md).

Use the Phonely API to generate and manage agents, inspect calls, manage agent knowledge sources, work with phone numbers, and retrieve organization data. The base URL is `https://app.phonely.ai/api`.

## Get your API key

1. Sign in to the Phonely app.
2. Open **Settings**, then select **Account**.
3. Under **Access**, reveal and copy the **API Key**.

## Authenticate requests

Send the key in the `X-Authorization` header unless an endpoint states that authentication is not required.

```bash theme={null}
curl https://app.phonely.ai/api/agent-generations/GENERATION_ID \
  -H "X-Authorization: YOUR_API_KEY"
```

## Generate an agent

1. [Start an agent generation](https://docs.phonely.ai/api-reference/endpoint/generate-agent.md) with a prompt and an idempotency key.
2. [Check the generation status](https://docs.phonely.ai/api-reference/endpoint/get-agent-generation.md) until it completes or fails.

The navigation groups the remaining endpoints by resource. Each endpoint guide documents its request, response, access checks, and important limitations.

To add browser-based voice calls to your own application, use the [Web SDK](https://docs.phonely.ai/api-reference/web-sdk.md).

## Supported API surface

The endpoints listed in this API Reference are the supported customer API contract. Routes used internally by the Phonely application, including billing and Ask AI operations, are not public integration endpoints even when they use an `/api` URL.

> [!WARNING]
>
> Keep your API key confidential. Do not share it publicly or commit it to source control.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.