action square_list_customer_segments { label: "ListCustomerSegments" description: "Retrieves the list of customer segments of a business." provider: square method: GET path: "/v2/customers/segments" encoding: json input: { type: "object" properties: { cursor: { type: "string" } limit: { type: "integer" } } additionalProperties: false } output: { type: "object" description: "Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint.\n\nEither `errors` or `segments` is present in a given response (never both)." properties: { cursor: { type: "string" description: "A pagination cursor to be used in subsequent calls to `ListCustomerSegments`\nto retrieve the next set of query results. The cursor is only present if the request succeeded and\nadditional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." } errors: { type: "array" description: "Any errors that occurred during the request." items: { type: "object" description: "Represents an error encountered during a request to the Connect API.\n\nSee [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information." required: ["category", "code"] properties: { category: { type: "string" description: "The high-level category for the error." } code: { type: "string" description: "The specific code of the error." } detail: { type: "string" description: "A human-readable description of the error for debugging purposes." } field: { type: "string" description: "The name of the field provided in the original request (if any) that\nthe error pertains to." } } } } segments: { type: "array" description: "The list of customer segments belonging to the associated Square account." items: { type: "object" description: "Represents a group of customer profiles that match one or more predefined filter criteria. \n\nSegments (also known as Smart Groups) are defined and created within the Customer Directory in the\nSquare Seller Dashboard or Point of Sale." required: ["name"] properties: { created_at: { type: "string" description: "The timestamp when the segment was created, in RFC 3339 format." } id: { type: "string" description: "A unique Square-generated ID for the segment." } name: { type: "string" description: "The name of the segment." } updated_at: { type: "string" description: "The timestamp when the segment was last updated, in RFC 3339 format." } } } } } } }