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

# Activities

> Track and manage all interactions with customer accounts

Activities capture all interactions and engagements with customer accounts in the Thena platform, providing a comprehensive timeline of customer relationships.

## Understanding activities

<CardGroup cols={1}>
  <Card title="Core purpose" icon="calendar-days">
    Activities provide a structured way to track, manage, and analyze all customer interactions. They help maintain a complete history of engagements and ensure proper follow-up on customer communications.
  </Card>
</CardGroup>

## Activity types

<CardGroup cols={2}>
  <Card title="Communication activities" icon="comments">
    • Meetings: In-person or virtual <br />
    • Calls: Phone conversations <br />
    • Emails: Email threads <br />
    • Chat: Instant messaging <br />
  </Card>

  <Card title="Business activities" icon="briefcase">
    • Site visits: On-premise meetings <br />
    • Reviews: Performance discussions <br />
    • Presentations: Product demos <br />
    • Training: Customer education <br />
  </Card>
</CardGroup>

## Standard fields

### Required fields

| Name               | Type      | Options  | Comments                      |
| :----------------- | :-------- | :------- | :---------------------------- |
| Account ID         | string    | Required | Associated account identifier |
| Activity Timestamp | timestamp | Required | When the activity occurred    |
| Duration           | integer   | Required | Length of activity in minutes |
| Location           | string    | Required | Physical or virtual location  |

### Optional fields

| Name            | Type   | Options                                                          | Comments                  |
| :-------------- | :----- | :--------------------------------------------------------------- | :------------------------ |
| Type            | string | Optional, Values: \[CALL (default), EMAIL, MEETING, SITE\_VISIT] | Activity type reference   |
| Status          | string | Optional, Values: \[PENDING (default), COMPLETED, CANCELLED]     | Activity status reference |
| Participants    | jsonb  | Optional, Default: \[]                                           | List of participants      |
| Attachment URLs | array  | Optional                                                         | List of attachment URLs   |

### System-managed fields

| Name        | Type      | Options        | Comments                            |
| :---------- | :-------- | :------------- | :---------------------------------- |
| Activity ID | bigserial | Auto-generated | Primary key                         |
| UID         | text      | Auto-generated | Unique identifier (ULID)            |
| Is Active   | boolean   | Default: true  | Activity's active status            |
| Created By  | bigint    | Auto-populated | References user table               |
| Created At  | timestamp | Auto-populated | Creation timestamp with timezone    |
| Updated At  | timestamp | Auto-populated | Last update timestamp with timezone |
| Deleted At  | timestamp | Optional       | Soft delete timestamp with timezone |

<Note>
  Database types:

  * Account ID and Created By are stored as `bigint` in the database
  * Location is stored as `text`
  * Duration is stored as `integer`
  * Participants is stored as `jsonb`
  * System fields use their respective database types (`bigserial`, `text`, `boolean`, `timestamp with time zone`)
</Note>

## Activity tracking

<Steps>
  <Step title="Planning">
    * Schedule activities
    * Set clear objectives
    * Identify participants
    * Prepare required materials
  </Step>

  <Step title="Execution">
    * Record attendance
    * Document key points
    * Track action items
    * Note decisions made
  </Step>

  <Step title="Follow-up">
    * Update activity status
    * Create follow-up tasks
    * Share meeting notes
    * Schedule next steps
  </Step>
</Steps>

## Best practices

<CardGroup cols={2}>
  <Card title="Documentation" icon="pen-to-square">
    • Record activities promptly <br />
    • Include all relevant details <br />
    • Link to related records <br />
    • Maintain consistent format <br />
  </Card>

  <Card title="Organization" icon="folder-tree">
    • Use clear subject lines <br />
    • Categorize properly <br />
    • Tag all participants <br />
    • Set appropriate privacy <br />
  </Card>
</CardGroup>

## API endpoints

### Sample activity

```json theme={null}
{
  "accountId": "ACC123",
  "title": "Quarterly Business Review",
  "type": "MEETING",
  "typeId": "T123",
  "typeConfiguration": {
    "icon": "video",
    "color": "#4CAF50"
  },
  "status": "SCHEDULED",
  "statusId": "S123",
  "statusConfiguration": {
    "icon": "calendar",
    "color": "#2196F3"
  },
  "activityTimestamp": "2024-03-20T14:00:00Z",
  "duration": 60,
  "location": "https://meet.google.com/abc-defg-hij",
  "participants": ["USER123", "USER456"],
  "attachmentUrls": [
    "https://storage.thena.ai/documents/agenda.pdf",
    "https://storage.thena.ai/documents/presentation.pdf"
  ],
  "metadata": {
    "agenda": "1. Q3 Review\n2. Q4 Goals\n3. Action Items",
    "meetingType": "QBR",
    "requiredPreparation": "Please review Q3 metrics before the meeting"
  }
}
```

<Note>
  When creating an activity, the system will add additional fields in the response such as:

  * `id`: Unique identifier for the activity
  * `account`: Name of the associated account
  * `creator`: Name of the activity creator
  * `creatorId`: ID of the creator
  * `creatorEmail`: Email of the creator
  * `createdAt`: Creation timestamp
  * `updatedAt`: Last update timestamp
</Note>

### Available operations

<Accordion title="Activity management" icon="calendar-days">
  ```bash theme={null}
  # List account activities
  GET /v1/accounts/{accountId}/activities

  # Create account activity
  POST /v1/accounts/{accountId}/activities
  Content-Type: application/json

  # Get activity by ID
  GET /v1/accounts/{accountId}/activities/{activityId}

  # Update activity
  PATCH /v1/accounts/{accountId}/activities/{activityId}
  Content-Type: application/json

  # Delete activity
  DELETE /v1/accounts/{accountId}/activities/{activityId}
  ```

  <Note>
    All endpoints require authentication with Bearer token, API key, and Organization ID in the headers.
  </Note>

  For detailed API specifications, see <a href="/api-reference/platform/accounts/activities" target="_blank">Activity Management</a>
</Accordion>

## Related resources

<CardGroup cols={2}>
  <Card title="Accounts overview" icon="building-user" href="/platform/core-concepts/accounts/overview">
    Learn about account management
  </Card>

  <Card title="Contacts" icon="address-book" href="/platform/core-concepts/accounts/contacts">
    Manage customer contacts
  </Card>
</CardGroup>
