# Introduction

> The base URL, how requests are authenticated and the conventions every endpoint follows.

The Crackle API is a JSON API over HTTPS. This page covers what every request has in common; the pages beside it cover each request one at a time.

## Base URL

Base URL:

```
https://goblins-call-api.onrender.com
```

Every path in this reference is relative to it, and every path starts with `/v1`.

## Authentication

Send an API key as a bearer token with every request. Keys are made in the studio under **API keys**: see [Authentication](https://www.cracklehq.com/docs/authentication).

Request:

cURL:

```bash
curl "https://goblins-call-api.onrender.com/v1/me" \
  -H "Authorization: Bearer $CRACKLE_API_KEY"
```

Node.js:

```js
const response = await fetch('https://goblins-call-api.onrender.com/v1/me', {
  headers: {
    Authorization: `Bearer ${process.env.CRACKLE_API_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://goblins-call-api.onrender.com/v1/me",
    headers={"Authorization": f"Bearer {os.environ['CRACKLE_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()
```

## Requests and responses

- Bodies are JSON. Send `Content-Type: application/json` with any request that has one.
- Responses are JSON, with the result under a named key, such as `agent`, `calls` or `webhook`.
- Times are ISO 8601 strings in UTC, such as `2026-10-11T05:56:12.000Z`. Durations are in seconds and money is in US dollars.
- IDs are strings with a prefix that says what they are: `ua_` for an agent, `tool_` for a tool, `wh_` for a webhook subscription and `usr_` for a workspace. A call’s ID is a UUID.

## Your workspace

A key acts in the one workspace it belongs to, so nothing needs to say which workspace a request is about. Things in other workspaces answer `404`. In paths, a workspace is a `user`: `/v1/users/:id` is your workspace, not a person.

## Paging

[List calls](https://www.cracklehq.com/docs/reference/calls/list) returns a page at a time, newest first, with a `nextCursor` when there is more. Pass it back as `before` to get the next page. [List voices](https://www.cracklehq.com/docs/reference/voices/list) pages the same way with `nextPage` and `after`. The other lists are short and come back whole.

## Errors

A failed request answers with a `4xx` or `5xx` status and a body of `{ error, code, status }`. Branch on `code`. The full list is in [Errors](https://www.cracklehq.com/docs/errors), and the limits behind a `429` are in [Rate limits and concurrency](https://www.cracklehq.com/docs/limits).

## Endpoints

### Agents

[`GET` `/v1/agents`List agents](https://www.cracklehq.com/docs/reference/agents/list)[`POST` `/v1/agents`Create an agent](https://www.cracklehq.com/docs/reference/agents/create)[`GET` `/v1/agents/:id`Get an agent](https://www.cracklehq.com/docs/reference/agents/get)[`PATCH` `/v1/agents/:id`Update an agent](https://www.cracklehq.com/docs/reference/agents/update)[`DELETE` `/v1/agents/:id`Delete an agent](https://www.cracklehq.com/docs/reference/agents/delete)[`POST` `/v1/agents/draft`Draft an agent with AI](https://www.cracklehq.com/docs/reference/agents/draft)[`POST` `/v1/agents/draft/transcribe`Transcribe a dictated description](https://www.cracklehq.com/docs/reference/agents/transcribe)[`POST` `/v1/agents/:id/rotate-key`Rotate an agent’s key](https://www.cracklehq.com/docs/reference/agents/rotate-key)[`POST` `/v1/agents/:id/rotate-public-key`Rotate the publishable key](https://www.cracklehq.com/docs/reference/agents/rotate-public-key)

### Calls

[`POST` `/v1/calls`Start a call](https://www.cracklehq.com/docs/reference/calls/start)[`GET` `/v1/calls`List calls](https://www.cracklehq.com/docs/reference/calls/list)[`GET` `/v1/calls/:id`Get a call](https://www.cracklehq.com/docs/reference/calls/get)[`POST` `/v1/calls/:id/say`Speak into a call](https://www.cracklehq.com/docs/reference/calls/say)[`POST` `/v1/calls/:id/end`End a call](https://www.cracklehq.com/docs/reference/calls/end)

### Embed

[`POST` `/v1/embed/calls`Start a call with a publishable key](https://www.cracklehq.com/docs/reference/embed/start)

### Tools

[`GET` `/v1/tools`List tools](https://www.cracklehq.com/docs/reference/tools/list)[`POST` `/v1/tools`Create a tool](https://www.cracklehq.com/docs/reference/tools/create)[`GET` `/v1/tools/:id`Get a tool](https://www.cracklehq.com/docs/reference/tools/get)[`PUT` `/v1/tools/:id`Update a tool](https://www.cracklehq.com/docs/reference/tools/update)[`DELETE` `/v1/tools/:id`Delete a tool](https://www.cracklehq.com/docs/reference/tools/delete)[`POST` `/v1/tools/:id/test`Test a tool](https://www.cracklehq.com/docs/reference/tools/test)

### Knowledge

[`GET` `/v1/knowledge/documents`List documents](https://www.cracklehq.com/docs/reference/knowledge/list)[`POST` `/v1/knowledge/documents`Add a document](https://www.cracklehq.com/docs/reference/knowledge/add)[`GET` `/v1/knowledge/documents/:id`Get a document](https://www.cracklehq.com/docs/reference/knowledge/get)[`POST` `/v1/knowledge/documents/:id/retry`Read a document again](https://www.cracklehq.com/docs/reference/knowledge/retry)[`DELETE` `/v1/knowledge/documents/:id`Delete a document](https://www.cracklehq.com/docs/reference/knowledge/delete)[`POST` `/v1/knowledge/search`Search documents](https://www.cracklehq.com/docs/reference/knowledge/search)

### Webhooks

[`GET` `/v1/webhooks/events`List event types](https://www.cracklehq.com/docs/reference/webhooks/events)[`GET` `/v1/webhooks`List subscriptions](https://www.cracklehq.com/docs/reference/webhooks/list)[`POST` `/v1/webhooks`Create a subscription](https://www.cracklehq.com/docs/reference/webhooks/create)[`GET` `/v1/webhooks/:id`Get a subscription](https://www.cracklehq.com/docs/reference/webhooks/get)[`PATCH` `/v1/webhooks/:id`Update a subscription](https://www.cracklehq.com/docs/reference/webhooks/update)[`DELETE` `/v1/webhooks/:id`Delete a subscription](https://www.cracklehq.com/docs/reference/webhooks/delete)[`POST` `/v1/webhooks/:id/test`Send a test event](https://www.cracklehq.com/docs/reference/webhooks/test)

### Voices and catalog

[`GET` `/v1/providers/voices`List voices](https://www.cracklehq.com/docs/reference/voices/list)[`GET` `/v1/providers/voices/:id/preview`Play a voice sample](https://www.cracklehq.com/docs/reference/voices/preview)[`GET` `/v1/catalog`Get the catalog](https://www.cracklehq.com/docs/reference/catalog)

### Workspace

[`GET` `/v1/me`Check a key](https://www.cracklehq.com/docs/reference/workspace/me)[`GET` `/v1/users/:id`Get the workspace](https://www.cracklehq.com/docs/reference/workspace/get)[`GET` `/v1/users/:id/passbook`List balance history](https://www.cracklehq.com/docs/reference/workspace/usage)[`GET` `/v1/billing`Get plan and payments](https://www.cracklehq.com/docs/reference/workspace/billing)[`GET` `/v1/plans`Get the price list](https://www.cracklehq.com/docs/reference/plans)

Source: https://www.cracklehq.com/docs/reference
