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

# API Overview

> Authenticate with the Instance REST API (/api/v1), inspect standard JSON response envelopes, error codes, terminology, and rate limits.

# API Overview

The Instance Public API lets you connect external tools (such as Make, Zapier, n8n, or your own backend) directly to your workspace. You can query leads, manage tags and pipeline stages, reply in Sales Chat, schedule Instagram posts, and trigger automations programmatically.

Every endpoint in the sidebar comes with live `cURL`, JavaScript, and Python examples plus an interactive **Try it** playground.

***

## 1. Base URL

* **Production / Cloud**: `https://api.yourdomain.com/api/v1`
* **Local Self-Hosted**: `http://localhost:4000/api/v1`

***

## 2. Authentication

Instance uses workspace-scoped API keys (`inst_live_...`) instead of per-user OAuth2 tokens for public API access:

1. Open **Dashboard -> Settings -> API Keys**.
2. Click **Create New Key** and give it a label.
3. Copy your generated key (`inst_live_...`). It is only shown once.

Pass your key in the `X-API-Key` header (or `Authorization: Bearer`) on every request:

```bash theme={null}
curl -X GET "http://localhost:4000/api/v1/workspace/info" \
  -H "X-API-Key: inst_live_your_api_key_here"
```

***

## 3. Rate Limits

Public API endpoints are rate-limited to **60 requests per minute** per workspace API key. If your integration exceeds this limit, the API returns HTTP `429 Too Many Requests`.

***

## 4. JSON Output and Error Handling

Every endpoint returns a consistent JSON envelope with `status: "success"` or `status: "error"`.

### Success Response

```json theme={null}
{
  "status": "success",
  "data": {
    "id": "cuid_123",
    "ig_username": "sarah_coach",
    "name": "Sarah Jenkins",
    "email": "sarah@example.com",
    "phone": "+14155552671",
    "followers_count": 14200,
    "qualification_score": 88,
    "is_qualified": true,
    "status": "Qualified",
    "tags": ["VIP", "High Budget"]
  }
}
```

### Error Response

```json theme={null}
{
  "status": "error",
  "message": "Contact not found in this workspace",
  "code": 404
}
```

| HTTP Status | Meaning |
| :- | :- |
| `200` / `201` | Request succeeded (or resource created). |
| `400` | Invalid query parameter or request body. |
| `401` | Missing or invalid `X-API-Key` / Bearer token. |
| `404` | Contact, conversation, or resource not found in this workspace. |
| `429` | Rate limit exceeded (`60` requests/minute per API key). |
| `500` | Unexpected server error. |

***

## 5. Terminology

* **Workspace**: Your company account containing connected Instagram handles, team members, leads, and flows.
* **Contact (Lead)**: An Instagram user who has messaged, commented, mentioned you, or submitted a Bio Link form.
* **Conversation**: A Sales Chat DM thread tied to a contact, with AI active/paused state, Whisper Notes, and deal status.
* **Automation**: A visual DM, Comment, Live, or Story flow that can be triggered or inspected via API.
* **Audience List**: A segmented list of contacts with captured emails or phone numbers.
* **Webhook**: An HTTPS callback signed with `HMAC-SHA256` (`X-Instance-Signature-256`) that notifies your server in real time. See [Outbound Webhooks](/docs/api-reference/webhooks.md).


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