Activities API

Track interactions with contacts and deals — calls, emails, meetings, notes, and custom activity types.

See also: Activities & Tasks concepts

Endpoints

MethodPathDescription
POST/activitiesCreate an activity
GET/activitiesList activities
GET/activities/:idGet an activity
PATCH/activities/:idUpdate an activity
DELETE/activities/:idDelete an activity

Create an activity

POST /activities

Request body

FieldTypeRequiredDescription
typestringyesActivity type: call, email, meeting, note, task, custom, other
subtypestringnoFreeform subtype (e.g. reply, bounce, demo)
statusstringnoStatus: draft, completed, scheduled, rejected
subjectstringnoOne-line summary
bodystringnoFull content or notes
contact_idstringnoAssociated contact
company_idstringnoAssociated company
deal_idstringnoAssociated deal
owner_idstringnoWho performed the activity
occurred_atdatetimenoWhen it happened (defaults to now)
durationintegernoDuration in seconds
directionstringnoDirection: inbound, outbound, na
sourcestringnoWhere this activity came from (e.g. gmail, instantly)
external_idstringnoID in the source system for dedup
metadataobjectnoArbitrary key-value data

AI-generated activities can also include generated_by, confidence_score, and model fields. See the OpenAPI spec for the complete field list.

Example

curl -X POST "$REX_URL/activities" \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "call",
    "status": "completed",
    "subject": "Discovery call with Ada",
    "contact_id": "cont_01HQ...",
    "deal_id": "deal_01HQ...",
    "occurred_at": "2026-03-16T14:00:00Z",
    "duration": 1800,
    "direction": "outbound"
  }'

Response

{
  "data": {
    "id": "act_01HQ...",
    "type": "call",
    "status": "completed",
    "subject": "Discovery call with Ada",
    "contact_id": "cont_01HQ...",
    "deal_id": "deal_01HQ...",
    "occurred_at": "2026-03-16T14:00:00Z",
    "duration": 1800,
    "direction": "outbound",
    "created_at": "2026-03-16T14:00:00Z",
    "updated_at": "2026-03-16T14:00:00Z"
  }
}

List activities

GET /activities

Query parameters

ParameterTypeDescription
cursorstringPagination cursor
limitintegerResults per page (default 50, max 200)
typestringFilter by activity type
statusstringFilter by status
subtypestringFilter by subtype
sourcestringFilter by source
contact_idstringFilter by contact
company_idstringFilter by company
deal_idstringFilter by deal
owner_idstringFilter by owner
afterdatetimeOnly activities occurring after this time
beforedatetimeOnly activities occurring before this time

Example

curl "$REX_URL/activities?type=email&contact_id=cont_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": [
    {
      "id": "act_01HQ...",
      "type": "email",
      "status": "completed",
      "subject": "Follow-up on proposal",
      "contact_id": "cont_01HQ...",
      "occurred_at": "2026-03-15T14:30:00Z",
      "direction": "outbound",
      "created_at": "2026-03-15T14:30:00Z",
      "updated_at": "2026-03-15T14:30:00Z"
    }
  ],
  "has_more": false
}

Get an activity

GET /activities/:id

Example

curl "$REX_URL/activities/act_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": {
    "id": "act_01HQ...",
    "type": "call",
    "status": "completed",
    "subject": "Discovery call with Ada",
    "body": "Discussed requirements. Ada interested in enterprise plan.",
    "contact_id": "cont_01HQ...",
    "deal_id": "deal_01HQ...",
    "owner_id": "user_01HQ...",
    "occurred_at": "2026-03-16T14:00:00Z",
    "duration": 1800,
    "direction": "outbound",
    "source": "manual",
    "metadata": {},
    "relationships": {
      "contact": { "type": "contact", "id": "cont_01HQ...", "name": "Ada Lovelace" },
      "deal": { "type": "deal", "id": "deal_01HQ...", "name": "Acme Enterprise Plan" }
    },
    "created_at": "2026-03-16T14:00:00Z",
    "updated_at": "2026-03-16T14:00:00Z"
  },
  "included": [
    { "type": "contact", "id": "cont_01HQ...", "name": "Ada Lovelace" }
  ]
}

Update an activity

PATCH /activities/:id

All fields from the create request body are accepted. Only provided fields are updated.

Example

curl -X PATCH "$REX_URL/activities/act_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Discussed requirements. Ada interested in enterprise plan. Follow-up scheduled for next week."
  }'

Response

Returns the full updated activity in the same format as Get an activity.

Delete an activity

DELETE /activities/:id

Example

curl -X DELETE "$REX_URL/activities/act_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

204 No Content on success.

Was this page helpful?

·