# Activities

An **Activity** is a manually-logged interaction attached to a record (Object or Table row). Activities let you track what happened with a contact, deal, ticket, or any other record — without polluting the record's own fields.

Examples of what an activity represents:

- A note left by a rep after a call: *"Called re: pricing, very interested"*
- A meeting logged with attendees and a date
- A manually recorded email exchange
- A WhatsApp conversation summary


> Activities are created manually (by humans or automations via the API). Auto-generated interactions — email sync, conversation audit logs, file uploads — also appear in a record's timeline but are **read-only** (they cannot be deleted or edited via the API).


## Activity types

| Type | Description |
|  --- | --- |
| `NOTE` | Free-form text note (default). Use for anything generic. |
| `EMAIL` | Manually logged email exchange. |
| `PHONE_CALL` | Phone call. |
| `MEETING` | In-person or video meeting. |
| `WHATSAPP` | WhatsApp message thread. |


## Fields

| Field | Type | Notes |
|  --- | --- | --- |
| `id` | number | Use as `activityId`. |
| `type` | enum | One of the types above. Defaults to `NOTE`. |
| `content` | string | The activity body text. Required on create. |
| `activity_date` | datetime? | When the interaction actually happened. Defaults to the creation timestamp if omitted. |
| `additional_data` | object? | Freeform JSON metadata. Useful for structured extras (e.g. `{"duration":30,"outcome":"interested"}`). |
| `user_ids` | number[]? | Users to tag as participants/attendees (e.g. who was on the call). Stored as `users` on output. |
| `related_table_id` | number? | Table/object `id` of a linked record. Must be paired with `related_row_id`. |
| `related_row_id` | string? | Row ID of the linked record. Useful to cross-link activities across objects. |
| `created_by` | number? | User ID of the creator. |
| `created_at` | datetime | When the activity was created in Frontline. |


## Operations

Activities are sub-resources of rows — paths are `/rows/{rowId}/activities` for list/create and `/activities/{id}` for get/update/delete.

### Objects

| Verb | Path | Purpose |
|  --- | --- | --- |
| `GET` | `/public/v1/objects/{name}/rows/{rowId}/activities` | List activities for a row |
| `POST` | `/public/v1/objects/{name}/rows/{rowId}/activities` | Create activity |
| `GET` | `/public/v1/objects/{name}/activities/{id}` | Get one activity |
| `PATCH` | `/public/v1/objects/{name}/activities/{id}` | Update activity |
| `DELETE` | `/public/v1/objects/{name}/activities/{id}` | Delete activity |


### Tables

| Verb | Path | Purpose |
|  --- | --- | --- |
| `GET` | `/public/v1/tables/{name}/rows/{rowId}/activities` | List activities for a row |
| `POST` | `/public/v1/tables/{name}/rows/{rowId}/activities` | Create activity |
| `GET` | `/public/v1/tables/{name}/activities/{id}` | Get one activity |
| `PATCH` | `/public/v1/tables/{name}/activities/{id}` | Update activity |
| `DELETE` | `/public/v1/tables/{name}/activities/{id}` | Delete activity |


### Delete rules

Only **manually-created** activities can be deleted. Only the activity owner or an account admin can delete.

## CLI

```bash
# List
frontline object activity list deals 6625abc123def456 --table

# Create — simple note
frontline object activity create deals 6625abc --content "Follow up next week"

# Create — phone call with date, participants, and metadata
frontline object activity create deals 6625abc \
  --content "30-min call, very interested" \
  --type PHONE_CALL \
  --activity-date 2026-06-01T15:00:00Z \
  --user-ids 12,34 \
  --additional-data '{"duration":30,"outcome":"interested"}'

# Create — meeting linked to a related Company record
frontline object activity create contacts 6625abc \
  --content "Kickoff meeting with Acme" \
  --type MEETING \
  --related-table-id 5 \
  --related-row-id 6626def000aabb112233

# Get
frontline object activity get deals 42 --pretty

# Update
frontline object activity update deals 42 --content "Updated: will call back Friday"

# Delete
frontline object activity delete deals 42
```

## API example

```json
POST /public/v1/objects/deals/rows/6625abc123def456/activities
{
  "content": "Discussed contract terms on call",
  "type": "PHONE_CALL",
  "activityDate": "2026-06-01T15:00:00Z",
  "userIds": [12, 34],
  "additionalData": { "duration": 45, "outcome": "needs_approval" }
}
```