API Reference

The Rex API is a JSON HTTP API. All endpoints are relative to your tenant base URL (https://{subdomain}.rexgtm.com).

Authentication

Include your API key in every request:

curl https://acme.rexgtm.com/contacts \
  -H "X-Api-Key: rex_live_..."

See Authentication for key scopes and rate limits.

Common patterns

Pagination

All list endpoints use cursor-based pagination:

curl "$REX_URL/contacts?limit=25&cursor=eyJpZCI6..."
  -H "X-Api-Key: $REX_API_KEY"

Response includes pagination metadata:

{
  "data": [ ... ],
  "meta": {
    "cursor": "eyJpZCI6...",
    "has_more": true
  }
}

Pass the returned cursor as a query parameter to fetch the next page. When has_more is false, you've reached the end.

Filtering

List endpoints accept query parameters for filtering:

# Contacts with stage "prospect"
GET /contacts?stage=prospect

# Deals in a specific pipeline
GET /deals?pipeline_id=pipe_01HQ...

# Activities for a contact
GET /activities?contact_id=cont_01HQ...

Sparse fieldsets

Request only the fields you need with the fields parameter:

GET /contacts?fields=id,email,first_name,stage

Including related entities

Eager-load related data with the include parameter:

GET /contacts/cont_01HQ...?include=company,activities

Sorting

GET /contacts?sort=-created_at    # newest first
GET /deals?sort=value             # lowest value first

Prefix with - for descending order.

Response envelope

Single entity:

{
  "data": {
    "id": "cont_01HQ...",
    "email": "ada@example.com",
    ...
  }
}

List:

{
  "data": [ ... ],
  "meta": {
    "cursor": "...",
    "has_more": true
  }
}

Error:

{
  "error": {
    "code": "not_found",
    "message": "Contact not found"
  }
}

IDs

All entity IDs use the TypeID format — a type prefix followed by a ULID:

EntityPrefixExample
Contactcont_cont_01HQ2X4G5...
Companycomp_comp_01HQ2X4G5...
Dealdeal_deal_01HQ2X4G5...
Pipelinepipe_pipe_01HQ2X4G5...
Activityact_act_01HQ2X4G5...
Tasktask_task_01HQ2X4G5...
Productprod_prod_01HQ2X4G5...
Eventevt_evt_01HQ2X4G5...
Webhookwh_wh_01HQ2X4G5...

OpenAPI spec

The complete OpenAPI 3.0 specification is available at:

GET /openapi.yaml

Use it to generate client libraries, explore in Swagger UI, or feed to AI agents for schema discovery.

Resources

Browse detailed endpoint documentation for each resource:

Was this page helpful?

·