> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/segment/retrieve-list-of-segments.md).

# Retrieve list of segments

The site's active segments — name, status, the expression and its description; size with includeSize=true. Page size 5, newest first. Lists: GET /lists.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"Segment","description":"Segments"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"Segment":{"type":["object"],"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["segments"]},"attributes":{"type":"object","required":["id","name","status","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","calculating","syncing","unable-to-sync","dormant"],"description":"The dashboard's Status column. active = membership kept current. calculating = segment being (re)computed.\nsyncing = Klaviyo sync in progress. unable-to-sync = Klaviyo sync failed or the Klaviyo list was deleted.\ndormant = unused for 30 days (14 for Klaviyo-based), membership dropped, size 0.\n"},"size":{"type":"integer","description":"Currently subscribed SMS subscribers, live; 0 while dormant. On\nthe list only with includeSize=true, on the detail always.\n"},"dormantAt":{"type":"string","format":"date-time","description":"dormant only"},"editedAt":{"type":"string","format":"date-time","description":"Last change to name or expression"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"expression":{"$ref":"#/components/schemas/Expression","description":"The membership rule, AND of ORs, ids resolved to names"},"description":{"type":"string","description":"The expression description in a sentence"}}}}},"Expression":{"type":"object","required":["and"],"properties":{"and":{"type":"array","description":"Every group must hold","items":{"type":"object","required":["or"],"properties":{"or":{"type":"array","description":"At least one condition of the group must hold","items":{"$ref":"#/components/schemas/Condition"}}}}}}},"Condition":{"type":"object","required":["slug","type"],"properties":{"slug":{"type":"string"},"type":{"type":"string","enum":["boolean","number","string","date","array"]},"operator":{"type":"string","enum":["eq","neq","lt","gt","include","not_include","exist","not_exist"],"description":"Absent on date conditions"},"field":{"type":"string","description":"subscriber-detail only"},"value":{"description":"String, number, boolean or array of strings; absent when values is present"},"values":{"type":"array","description":"Replaces value when it is an entity id; name empty when unresolved","items":{"$ref":"#/components/schemas/SegmentReference"}},"dateFilter":{"type":"object","properties":{"type":{"type":"string","enum":["all","between","not-between","since","until","on","in-the-last","not-in-the-last","exist","not-exist"]},"dateFrom":{"type":"string","format":"date-time"},"dateTo":{"type":"string","format":"date-time"},"daysOffset":{"type":"integer"}}},"filters":{"type":"object","description":"occurrence narrows to the first or last event; count (visited-page) asks for at least min matching page views","properties":{"occurrence":{"type":"string","enum":["first","last"]},"count":{"type":"object","required":["min"],"properties":{"min":{"type":"integer","minimum":1}}}}},"subcondition":{"$ref":"#/components/schemas/Subcondition"},"subconditions":{"type":"array","description":"visited-page only — rows that all apply to the same page view (page, product, collection, utm), in place of subcondition","items":{"$ref":"#/components/schemas/Subcondition"}}}},"SegmentReference":{"type":"object","description":"A segment of the campaign audience, or a resolved value of an\nexpression condition. name is the referenced entity's current\nname, or an empty string when it could not be resolved (for\nexample a deleted segment).\n","required":["id","name"],"properties":{"id":{"type":"string","description":"ID of the segment"},"name":{"type":"string","description":"Current name of the segment, empty when unresolved"}}},"Subcondition":{"type":"object","description":"Narrows a condition to one entity or attribute; value is the literal, values the resolved { id, name } entries","required":["slug","category","operator"],"properties":{"slug":{"type":"string","enum":["flow","product","subscription-source","location-category","klaviyo-segment-or-list","page","collection","utm"]},"category":{"type":"string"},"operator":{"type":"string","enum":["eq","neq","lt","gt","include","not_include","exist","not_exist"]},"value":{"description":"Literal, absent when values is present"},"values":{"type":"array","items":{"$ref":"#/components/schemas/SegmentReference"}}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/segments":{"get":{"summary":"Retrieve list of segments","tags":["Segment"],"operationId":"listSegments","description":"The site's active segments — name, status, the expression and its\ndescription; size with includeSize=true. Page size 5, newest first.\nLists: GET /lists.\n","parameters":[{"name":"limit","in":"query","description":"Maximum number of segments to return","schema":{"type":"integer","minimum":1,"maximum":5,"default":5}},{"name":"offset","in":"query","description":"Number of segments to skip, for pagination","schema":{"type":"integer","minimum":0,"default":0}},{"name":"ids","in":"query","description":"Only these segments","schema":{"type":"array","items":{"type":"string"}}},{"name":"isMemberOf","in":"query","description":"Segments whose expression has a member-of-a-segment condition on this segment or list id","schema":{"type":"string"}},{"name":"includeSize","in":"query","description":"Compute the live size of each segment on the page","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Ok","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}}}}}},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.recart.com/developers/public-api/segment/retrieve-list-of-segments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
