# Contact Activity

> Get everything one contact did, from every source, newest first

URL: https://docs.lemuai.com/api-reference/contacts/activity

Returns a contact's activity timeline, newest first: events you sent, Shopify orders, website visits, message status changes, segment changes and custom record changes. It is the same timeline as the **Activity** tab on the contact's page.

The timeline covers the whole person:

- events stored against contacts that were later [merged](https://docs.lemuai.com/api-reference/events/trigger#how-the-contact-is-found) into this one;
- website visits made before the person was identified, through the visitor ids linked to the contact.

**Info:** **Setup required.** Activity is read from the event store. If the event store isn't turned on for your workspace, the response has `enabled: false` and no events. Use [List events](https://docs.lemuai.com/api-reference/events/list) in that case.

**Endpoint:** `GET /api/v1/contacts/{contact_id}/activity`

## Headers

| Name | Required | Description |
|---|---|---|
| `X-API-Key` | Yes | An API key from your organization. See [Authentication](https://docs.lemuai.com/api-reference/authentication). |

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `contact_id` | integer | Yes | The contact's `id`, from [List contacts](https://docs.lemuai.com/api-reference/contacts/list) or an upsert response. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | No | How many events to return, 1 to 200. Default `50`. |
| `before` | string | No | Only return events before this time, in ISO 8601. To get the next page, pass the `next_before` value from the previous response. |

**Example request:**

**cURL**

```bash
curl "https://app.lemuai.com/api/v1/contacts/901/activity?limit=20" \
  -H "X-API-Key: lemu_your_api_key"
```

**JavaScript**

```js
const res = await fetch("https://app.lemuai.com/api/v1/contacts/901/activity?limit=20", {
  method: "GET",
  headers: {
    "X-API-Key": process.env.LEMU_API_KEY,
  },
});
if (!res.ok) throw new Error(`LemuAI API ${res.status}: ${await res.text()}`);
const data = await res.json();
console.log(data);
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://app.lemuai.com/api/v1/contacts/901/activity?limit=20",
    headers={
        "X-API-Key": os.environ["LEMU_API_KEY"],
    },
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

## Response

**`200`**
```json
{
  "enabled": true,
  "events": [
    {
      "event_id": "3f6c2a9e-8d1b-5c7a-9e42-1b7d0c5a6f13",
      "event_type": "Purchase",
      "occurred_at": "2026-10-27T09:14:02.511000Z",
      "source": "api",
      "contact_id": 901,
      "anonymous_id": null,
      "properties": { "order_id": "SO-10422", "value": 2499, "currency": "INR" }
    },
    {
      "event_id": "a81d4c0e-27f3-4b0a-9a55-6c1e2f7b9d40",
      "event_type": "PageView",
      "occurred_at": "2026-10-27T09:02:40.118000Z",
      "source": "pixel",
      "contact_id": null,
      "anonymous_id": "6b1e2c4f-9a7d-4e3b-8c21-0f5d7a9e3b12",
      "properties": { "url": "https://shop.example.com/products/running-shoes" }
    }
  ],
  "next_before": null
}
```

| Field | Type | Description |
|---|---|---|
| `enabled` | boolean | `false` when the event store isn't turned on. `events` is then empty. |
| `events` | array | The events on this page, newest first. |
| `events[].event_id` | string | The event's unique id (UUID). |
| `events[].event_type` | string | The event name, for example `Purchase`, `PageView` or `message_delivered`. Events stored before Lemu switched to Meta's [standard event names](https://docs.lemuai.com/website-pixel/standard-events) keep their older name, such as `order_placed` or `page_viewed`. |
| `events[].occurred_at` | string | When it happened, in ISO 8601 (UTC). |
| `events[].source` | string | Where it came from: `api`, `shopify`, `pixel`, `messaging`, `segments`, `records` or `backfill`. See [Event sources](https://docs.lemuai.com/api-reference/events/list#event-sources). |
| `events[].contact_id` | integer or null | The contact the event was stored against: this contact or one merged into it. `null` for website activity from before the person was identified. |
| `events[].anonymous_id` | string or null | The website or app visitor id, for events from a tracking source. |
| `events[].properties` | object | The details of the event. |
| `next_before` | string or null | Pass this as `before` to get the next page. `null` on the last page. |

## Errors

| Status | When |
|---|---|
| `401` | The API key is missing or not valid. |
| `404` | No contact with this id in your organization. |
| `503` | The event store couldn't be read right now. Try again shortly. |

See [Errors](https://docs.lemuai.com/api-reference/errors) for the error format.
