Activities
Activities are the interactions your team has with contacts, companies, and projects — calls, emails, meetings, and notes. Each activity is logged on a timeline with structured metadata.
The Activity Object
Section titled “The Activity Object”| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier of the activity |
account_id | uuid | ID of the account that owns this activity |
created_by | uuid? | ID of the user who logged the activity; null if system-generated |
activity_type | string | Type of activity One of: call, email, meeting |
entity_id | uuid | ID of the record this activity is attached to |
entity_type | string | Record type the entity_id refers to One of: contact, company, project, deal |
occurred_at | datetime | When the activity occurred (ISO 8601) |
metadata | object | Type-specific fields keyed per the activity type schema (JSON object) |
created_at | datetime | Creation timestamp (ISO 8601) |
updated_at | datetime | Last update timestamp (ISO 8601) |
created_by_name | string | Display name of the user who logged the activity |
entity_name | string | Display name of the attached record |
Create a new activity
Section titled “Create a new activity”Endpoint: activities-create
| Field | Type | Required | Description |
|---|---|---|---|
activity_type | string | Yes | Type of activity being logged One of: call, email, meeting |
entity_id | string | No | ID of the record this activity is attached to |
entity_type | string | No | Record type the entity_id refers to One of: contact, company, project, deal |
occurred_at | datetime? | No | When the activity occurred (ISO 8601); defaults to now if omitted |
metadata | object | No | Type-specific fields validated against the activity type schema (JSON object) |
curl -X POST https://api.driftwoodapp.com/api/activities-create \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"activity_type": "..."}'Delete an activity
Section titled “Delete an activity”Endpoint: activities-delete
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the activity to delete |
curl -X POST https://api.driftwoodapp.com/api/activities-delete \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "..."}'Get an activity by ID
Section titled “Get an activity by ID”Endpoint: activities-get
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the activity to retrieve |
curl -X POST https://api.driftwoodapp.com/api/activities-get \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "..."}'List activities with optional filters
Section titled “List activities with optional filters”Endpoint: activities-list
| Field | Type | Required | Description |
|---|---|---|---|
entity_id | string? | No | Filter to activities attached to this record ID |
entity_type | string | No | Filter by record type One of: contact, company, project, deal |
types | string[] | No | Filter by one or more activity types One of: call, email, meeting |
cursor | string | No | Opaque pagination cursor from a previous response |
limit | int | No | Maximum number of activities to return |
curl -X POST https://api.driftwoodapp.com/api/activities-list \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'Update an existing activity
Section titled “Update an existing activity”Endpoint: activities-update
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the activity to update |
occurred_at | datetime? | No | New occurrence time (ISO 8601); omit to leave unchanged |
metadata | object? | No | New type-specific fields validated against the activity type schema; omit to leave unchanged |
curl -X POST https://api.driftwoodapp.com/api/activities-update \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "..."}'List activity type schemas
Section titled “List activity type schemas”Endpoint: activity-schemas-list
Error Codes
Section titled “Error Codes”| Code | Description |
|---|---|
activities.invalid_type | Invalid type |
activities.entity_required | Entity required |
activities.invalid_entity_type | Invalid entity type |
activities.invalid_metadata | Invalid metadata |
activities.invalid_id | Invalid id |
activities.not_found | Not found |
activities.invalid_entity_id | Invalid entity id |