> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# List Customer Segments

> Retrieves the list of customer segments of a business.

`square.listCustomerSegments` retrieves the list of customer segments of a business.

## Example

```ts automations/square-list-customer-segments.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("List Square Customer Segments", () => {
  onDashboardRun({ title: "List Square Customer Segments" })

  square.listCustomerSegments({
    cursor: "cursor",
    limit: 1,
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `CUSTOMERS_READ`.

| Field    | Type             | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                         |
| -------- | ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cursor` | `string \| null` | No       | —       | A pagination cursor returned by previous calls to `ListCustomerSegments`. This cursor is used to retrieve the next set of query results. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).                                                                                                                                                   |
| `limit`  | `number \| null` | No       | 50      | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |

Use the official [ListCustomerSegments reference](https://developer.squareup.com/reference/square/customer-segments-api/list-customer-segments) for provider field semantics and limits.

## Output

Returns the official `Square.ListCustomerSegmentsResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
