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

# Developer overview

> Build on Retainful: REST API, custom events, webhooks, and storefront tracking.

The Retainful API lets your systems talk to Retainful directly — create contacts, send custom events that trigger automations, and manage list membership. If you run a custom storefront, a subscription service, or any backend with customer activity, this is how you plug it in.

## What you can build

> [card] [Sync contacts](https://help.retainful.com/developers/api/contacts.md)
>
> Create and update contact profiles from your own systems — signups, profile changes, consent updates.

> [card] [Send custom events](https://help.retainful.com/developers/api/events.md)
>
> Track anything — bookings, renewals, quiz results — and use it to trigger automations and build segments.

> [card] [Manage lists](https://help.retainful.com/developers/api/contact-groups.md)
>
> Add and remove contacts from lists programmatically.

> [card] [Receive webhooks](https://help.retainful.com/developers/webhooks.md)
>
> Get an HTTP call to your endpoint when a contact reaches a webhook step in an automation.

## How the pieces fit

```text theme={null}
Your system ──POST /events──▶ Retainful ──triggers──▶ Automations ──▶ Email / WhatsApp
                                  │                        │
                                  ▼                        ▼
                              Segments ◀── profiles    Webhook step ──▶ your endpoint
```

1. **Authenticate** every request with an API key — see [Authentication](https://help.retainful.com/developers/authentication.md).
2. **Create contacts** or let events create them implicitly.
3. **Send events** as things happen. Events appear on contact timelines, are available to segments, and can [trigger automations](https://help.retainful.com/automations/triggers.md#custom-events).
4. **Receive webhooks** from automation flows to close the loop into your own systems.

## Conventions

* **Format** — JSON in, JSON out. Most responses use a JSON:API-style envelope: a `data` object with `type`, `id`, `attributes`, and `links`. [Adding a contact to a list](https://help.retainful.com/developers/api/contact-groups.md) is the exception and returns a plain object.
* **Field names** — snake\_case (`first_name`, not `firstName`). Unrecognized fields are rejected with `400` rather than ignored.
* **IDs** — resources are identified by stable unique IDs; contacts can also carry your own `external_id`.
* **Errors** — standard HTTP status codes with a JSON body; see [Errors](https://help.retainful.com/developers/errors.md).
* **Rate limits** — 10/second, 100/minute, 1,000/hour, counted per IP; see [Rate limits](https://help.retainful.com/developers/rate-limits.md).

## Quick example

```bash Track an event theme={null}
curl -X POST "https://api.retainful.net/api/v1/events" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $RETAINFUL_API_KEY" \
  -d '{
    "eventName": "Appointment Booked",
    "uniqueIdentifier": "booking_44812",
    "contact": { "email": "jane@example.com" },
    "eventData": {
      "service": "Consultation",
      "date": "2026-07-01"
    }
  }'
```

That single call creates the contact if needed, records the event on her timeline, and fires any automation triggered by `Appointment Booked`. The `uniqueIdentifier` makes it safe to retry — see [Idempotency](https://help.retainful.com/developers/api/events.md#idempotency).

> [!NOTE]
>
> The base URL for API requests is shown alongside your API key when you create it in **Integrations**.


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