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

# Overview

> The REST API the SDK calls, for any language.

The SDK is a thin client over this API. Use the API directly from any language, or to see exactly what goes over the wire.

## Base URL

```
https://crm.example.com/public-api
```

Use the address your CRM is served on. Every endpoint is versioned under `/v1`, and every one is a `POST` with a JSON body. Ids go in that body, never in the URL. `contacts/upsert` and `contacts/get` take your own `dbId`; every other endpoint takes the CRM's `partyId`, which upsert, get and `contacts/resolve` return.

## Authentication

Send an API key from **Settings → API keys** as a bearer token. Keys start with `gd_key_`.

```bash theme={null}
curl https://crm.example.com/public-api/v1/external-accounts/list \
  -H "Authorization: Bearer gd_key_..." \
  -H "Content-Type: application/json" \
  -d '{ "partyId": "01a1f7c6-3a71-74f2-8a38-22909d8dc050" }'
```

A call made with a key acts as the person who created it, in that key's workspace. A revoked key gets `401` straight away.

> [!WARNING]
>
> Keys can write to your workspace. Use them only from your backend.

## Responses

A successful call answers `200` with the result under `data`:

```json theme={null}
{
  "message": "Contact upserted",
  "metaData": {},
  "data": { "id": "…", "dbId": "user_42", "name": "Ada Lovelace" }
}
```

A failed one answers with an error status and a `type` and `message`:

```json theme={null}
{ "type": "not_found", "message": "contact not found" }
```

| `type` | Status | Meaning |
| - | - | - |
| `bad_request` | 400 | The input was rejected. `message` names the field. |
| `unauthorized` | 401 | The key is missing, wrong or revoked. |
| `forbidden` | 403 | The key may not do this. |
| `not_found` | 404 | Nothing has that id, or no such endpoint. |
| `conflict` | 409 | The account belongs to another contact with its own `dbId`. |
| `server_error` | 500 | Something failed on our side. Retrying is safe. |

## OpenAPI

The full spec is served at `/public-api/openapi`, and the reference in this tab is generated from it.


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