---
title: "Customers"
description: "Add customers, segment them, and record their activity."
url: "https://docs.goomzo.africa/docs/developers/python-sdk/customers"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Guides"
related:
  - /docs/developers/python-sdk/messages
  - /docs/developers/python-sdk/templates
  - /docs/developers/python-sdk/webhooks
---

> 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.

# Customers

> Add customers, segment them, and record their activity.

`goomzo.customers`, `goomzo.segments` and `goomzo.activity` keep Goomzo in step with your own system. See
[Customers](https://docs.goomzo.africa/docs/developers/customers?utm_source=llms&utm_medium=ai).

## Add or update customers

```python
saved = goomzo.customers.create(
    [{
        'name': 'Amina Juma',
        'phone': '+255712345678',
        'attributes': {'plan': 'gold'},
        'segments': [{'name': 'Shoppers'}],
        'activities': [{'key': 'purchased', 'value': 'Shoes'}],
    }],
    if_exists='update',
)

saved[0]['result']  # 'created', 'updated' or 'unchanged'
```

## Record customer activity

```python
goomzo.activity.record(
    [{'key': 'purchased', 'value': 'Shoes'}, {'key': 'spent', 'value': 45000}],
    phone='+255712345678',
)
```

## Segments

```python
for customer in goomzo.segments.customers.list('seg_4hq2v9n1c8x0t6pk'):
    print(customer['name'])

goomzo.segments.customers.add('seg_4hq2v9n1c8x0t6pk', ['cus_4hq2v9n1c8x0t6pk'])
```

## Other methods

| Method                               | Does                                 |
| ------------------------------------ | ------------------------------------ |
| `customers.list(q, segment, limit)`  | Lists customers, a page at a time.   |
| `customers.get(id)`                  | Gets one.                            |
| `customers.update(id, changes)`      | Changes one.                         |
| `customers.delete(id)`               | Deletes one.                         |
| `customers.segments.set(id, names)`  | Sets the segments a customer is in.  |
| `customers.activity.list(id)`        | Lists a customer's activity.           |
| `segments.create(segment)`           | Adds a segment, by hand or by rules. |
| `segments.customers.remove(id, ids)` | Takes customers out of a segment.    |

## Next steps

- [Lists](https://docs.goomzo.africa/docs/developers/python-sdk/lists?utm_source=llms&utm_medium=ai)
- [Send messages](https://docs.goomzo.africa/docs/developers/python-sdk/messages?utm_source=llms&utm_medium=ai)

---

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