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

# API Reference

> Integrate Relyable into your voice AI development workflow programmatically

The Relyable API allows you to programmatically manage your voice agents, test cases, personas, and testing workflows. Use it to integrate automated testing into your CI/CD pipeline or build custom tooling around Relyable.

## Authentication

All API endpoints require authentication using an API key. You can generate API keys from your workspace settings in the Relyable dashboard.

Include your API key in the `Authorization` header of all requests:

```bash theme={null}
curl --request GET \
  --url https://app.relyable.ai/api/agents \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json'
```

<Warning>
  **Keep your API key secure!** Never commit API keys to version control or expose them in client-side code. Treat them like passwords.
</Warning>

## Getting Your API Key

<Steps>
  <Step title="Navigate to Workspace Settings">
    In your Relyable dashboard, click on your workspace name and select **Settings**.
  </Step>

  <Step title="Generate API Key">
    Go to the **API Keys** section and click **Create New API Key**.

    Give your key a descriptive name (e.g., "Production CI/CD" or "Development Testing").
  </Step>

  <Step title="Copy and Store Securely">
    Copy the API key immediately - you won't be able to see it again. Store it in a secure location like environment variables or a secrets manager.
  </Step>
</Steps>

## Base URL

The base URL for all API requests is:

```
https://app.relyable.ai/api
```

All endpoints are relative to this base URL.

## Rate Limiting

API requests are rate limited based on your subscription plan:

| Plan           | Rate Limit          |
| -------------- | ------------------- |
| **Free**       | 60 requests/minute  |
| **Pro**        | 300 requests/minute |
| **Enterprise** | Custom limits       |

Rate limit headers are included in all responses:

```
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1640000000
```

If you exceed the rate limit, you'll receive a `429 Too Many Requests` response.

## Response Format

All responses are returned in JSON format with the following structure:

**Success Response:**

```json theme={null}
{
  "success": true,
  "data": {
    // Response data here
  }
}
```

**Error Response:**

```json theme={null}
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
```

## Common Response Codes

| Status Code | Meaning                                                 |
| ----------- | ------------------------------------------------------- |
| **200**     | Success - Request completed successfully                |
| **201**     | Created - Resource was created successfully             |
| **400**     | Bad Request - Invalid request parameters                |
| **401**     | Unauthorized - Invalid or missing API key               |
| **403**     | Forbidden - You don't have permission for this resource |
| **404**     | Not Found - Resource doesn't exist                      |
| **429**     | Too Many Requests - Rate limit exceeded                 |
| **500**     | Internal Server Error - Something went wrong on our end |

## Pagination

List endpoints (e.g., `/agents`, `/test-runs`) support pagination:

```bash theme={null}
GET /api/agents?page=1&limit=25
```

**Parameters:**

* `page` - Page number (default: 1)
* `limit` - Items per page (default: 25, max: 100)

**Paginated Response:**

```json theme={null}
{
  "success": true,
  "data": {
    "items": [...],
    "pagination": {
      "page": 1,
      "limit": 25,
      "total": 150,
      "pages": 6
    }
  }
}
```

## Webhooks

Relyable can send webhooks to your server when certain events occur:

* Test run completed
* Test run failed
* Agent score dropped below threshold
* Critical test case failed

Configure webhooks in your workspace settings. All webhook payloads are signed for security.

## Common Use Cases

### Automated CI/CD Testing

Trigger Relyable tests automatically when you deploy prompt changes:

```bash theme={null}
# After deploying your prompt update
curl --request POST \
  --url https://app.relyable.ai/api/agents/YOUR_AGENT_ID/test-runs \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "scenarios": ["scenario_1", "scenario_2"],
    "wait_for_completion": true
  }'
```

### Monitoring Production Quality

Fetch your agent's recent performance scores:

```bash theme={null}
curl --request GET \
  --url https://app.relyable.ai/api/agents/YOUR_AGENT_ID/metrics?period=7d \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

### Bulk Test Case Management

Import test cases from your own testing framework:

```bash theme={null}
curl --request POST \
  --url https://app.relyable.ai/api/agents/YOUR_AGENT_ID/test-cases/bulk \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "test_cases": [
      {
        "name": "Agent introduces correctly",
        "description": "Agent must introduce as Emily from Inflate Real Estate",
        "priority": "high"
      }
    ]
  }'
```

## SDKs and Libraries

Official SDKs coming soon for:

* **Node.js/TypeScript**
* **Python**
* **Go**

Currently, use standard HTTP clients to interact with the API.

## API Endpoints

Explore the available endpoints:

<CardGroup cols={2}>
  <Card title="Agents" icon="robot" href="/api-reference/endpoint/get">
    List, retrieve, and manage your voice agents
  </Card>

  <Card title="Test Runs" icon="flask" href="/api-reference/endpoint/create">
    Create and monitor automated test runs
  </Card>

  <Card title="Test Cases" icon="clipboard-check" href="/api-reference/endpoint/get">
    Manage test cases for your agents
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api-reference/endpoint/webhook">
    Configure webhooks for real-time notifications
  </Card>
</CardGroup>

## OpenAPI Specification

Download our complete OpenAPI specification for use with API clients, code generators, and documentation tools:

<Card title="Download OpenAPI Spec" icon="download" href="/api-reference/openapi.json">
  OpenAPI 3.0 JSON specification
</Card>

## Support

Need help with the API?

* **Email:** [support@relyable.ai](mailto:support@relyable.ai)
* **X/Twitter:** [@relyableai](https://x.com/relyableai)
* **Documentation:** [docs.relyable.ai](https://docs.relyable.ai)
* **Dashboard:** [app.relyable.ai](https://app.relyable.ai)

## Changelog

**v1.0.0** - Initial API release

* Core agent management endpoints
* Test run creation and monitoring
* Test case management
* Webhook support

Updates and improvements are continuously deployed. Breaking changes will be versioned.
