Documentation
Sign In

Quick Start

Go from zero to your first API request in about five minutes.

1. Create an API key

API keys are managed by organization admins at Settings → API Keys (/settings/api-keys). Create a key, choose the scopes it needs (for example contacts:read and contacts:write), and copy the key when it is shown — the full key is only displayed once.

Keys look like anch_ followed by 64 hex characters. Treat them like passwords; see API key security for rotation and storage guidance.

2. Make your first request

Pass the key in the Authorization header as a Bearer token. List your contacts:

curl https://your-domain.com/api/contacts \
  -H "Authorization: Bearer anch_your_api_key"

List responses share a common envelope with pagination metadata:

{
  "data": [
    { "id": "cnt_...", "firstName": "Jane", "lastName": "Doe", ... }
  ],
  "meta": { "total": 128, "limit": 50, "offset": 0 }
}

3. Create a record

Send JSON with Content-Type: application/json. Successful creates return 201with the new record's ID:

curl -X POST https://your-domain.com/api/contacts \
  -H "Authorization: Bearer anch_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane@acme.com"
  }'

# => 201 { "id": "cnt_V1StGXR8Z5jdHi6B" }

4. Update and delete

Updates use PATCH (or PUT) with only the fields you want to change, and return { "ok": true }. Deletes are soft for most resources:

curl -X PATCH https://your-domain.com/api/contacts/cnt_V1StGXR8Z5jdHi6B \
  -H "Authorization: Bearer anch_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "position": "VP of Operations" }'

# => 200 { "ok": true }

5. Handle errors

Errors use conventional status codes with a JSON body:

  • 401 — missing or invalid key: { "error": "Unauthorized" }
  • 403 — key lacks a scope: { "error": "Missing required scope: contacts:write" }
  • 404 — record not found or belongs to another organization: { "error": "Not found" }
  • 400 — validation failure; the error contains Zod field errors: { "error": { "fieldErrors": { "firstName": ["Required"] }, "formErrors": [] } }

Next steps