> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Sample Flows

## Article: Activities Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/activity-log/activity-v1/sample-flows.md

## Article Content:

# Activities API: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Record a custom activity

When you want to log something that happened with a contact, use a free-text custom activity. A custom activity carries a message you write yourself. Wix records it using a Generic template under the "Other apps" category.

To record a custom activity:

1. Call [Create Custom Activity](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/activity-log/activity-v1/create-custom-activity.md) with:
   - `contactId`: the contact this activity belongs to.
   - `message`: a free-text description of what happened.
   - `activityDate`: when the event occurred.

## Display a contact's activity timeline

Your app shows a contact's full history on their detail page, displaying what happened over time in chronological order: messages sent, subscription changes, and other recorded events.

To display a contact's activity timeline:

1. Call [List Activities](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/activity-log/activity-v1/list-activities.md) with the contact's ID. Omit `cursorPaging` on the first call. Optionally pass `categoryId`, `fromDate`, or `toDate` to narrow the results.
2. Render the returned activities. Each activity has an `activityDate` to use as the timeline timestamp and a `message` to display.
3. Check whether `metadata.cursors.next` is present in the response. If it is, call [List Activities](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/activity-log/activity-v1/list-activities.md) again with only `cursorPaging.cursor` set to `metadata.cursors.next`. Don't pass any other fields when using a cursor.
4. Append the new activities to your timeline and repeat step 3 until `metadata.cursors.next` is empty.
5. Optionally enrich activities that have a `templateId` by matching them against [List Templates](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/activity-log/template-v1/list-templates.md) results to display the template's icon and category.