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.

Requests

POST /v1/activity

Request syntax

{
  "phone": "<PHONE_NUMBER>",
  "activities": [{ "key": "<KEY>", "value": "<VALUE>", "occurredAt": "<TIME>" }]
}
PlaceholderDescriptionSample 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

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

Last updated