---
title: "Activity"
description: "Record customer activity, such as a purchase, from your own system."
url: "https://docs.goomzo.africa/docs/developers/customers/activity"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Customers"
related:
  - /docs/developers/customers
---

> For an index of all documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt). Any page is also available as Markdown by adding .md to its URL.

# Activity

> Record customer activity, such as a purchase, from your own system.

Customer activity is a record of things like buying shoes or spending 45,000. It shows in their history in Goomzo, and
segments can be built from it, such as everyone who bought in the last 30 days.

## Requirements

- An API key with the `activity.write` permission.
- The customer already added. See [Customers](https://docs.goomzo.africa/docs/developers/customers?utm_source=llms&utm_medium=ai).

## Requests

```text
POST /v1/activity
```

### Request syntax

```json
{
  "phone": "<PHONE_NUMBER>",
  "activities": [{ "key": "<KEY>", "value": "<VALUE>", "occurredAt": "<TIME>" }]
}
```

| Placeholder      | Description                                                                       | Sample value           |
| ---------------- | --------------------------------------------------------------------------------- | ---------------------- |
| `<PHONE_NUMBER>` | _String._ Who it was. Or use `email` or `customerId`: exactly one.                | `+255712345678`        |
| `<KEY>`          | _String._ The activity. Lower case letters, numbers and `_`, up to 40 characters. | `purchased`            |
| `<VALUE>`        | _String, number or boolean._ What it was.                                         | `Shoes`                |
| `<TIME>`         | _String. Optional._ When it happened, not in the future. Left out, now.           | `2026-11-10T15:20:00Z` |

### Example request

```bash
curl https://api.goomzo.africa/v1/activity \
  -H "Authorization: Bearer $GOOMZO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+255712345678",
    "activities": [
      { "key": "purchased", "value": "Shoes" },
      { "key": "spent", "value": 45000 }
    ]
  }'
```

## Responses

The answer is `201` with the `customerId` and the recorded `items`, in the order you sent them.

**Note:** If no customer has that phone or email, the answer is `404` and nothing is recorded. Add the customer
first, or send activities with them in `POST /v1/customers`.

## Notes

- **All or none:** up to 100 activities at once. If one isn't valid, none is, and the error names it, such as
  `activities[1].value`.
- **By id:** `POST /v1/customers/{id}/activity` does the same for a customer you know by id.

## Next steps

- [Segments](https://docs.goomzo.africa/docs/help/segments?utm_source=llms&utm_medium=ai)
- [Webhook events](https://docs.goomzo.africa/docs/developers/webhooks/events?utm_source=llms&utm_medium=ai)

---

For an index of all available documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt)
