---
title: "get all"
method: GET
path: "/segments"
tags: ["Segments"]
---

# get all

`GET /segments`

Returns a list of segments you've previously created. The segments will be returned in descending order of when they were created, unless you specify otherwise.
#### For custom components:
`RaiselyComponents.api.all('segments').get(params = {}, headers = {}) => Promise<{result}>`

 :fa-gears: See [Restie Response Data](https://github.com/raisely/restie#reading-and-handling-responses) for a more detailed overview of responses through the client wrapper

## Query parameters

- `private` boolean
- `q` string
- `limit` number
- `offset` number
- `sort` string
- `order` 'asc' | 'desc'
- `isShared` boolean
- `isTemporary` boolean
- `organisation` string
- `user` string

## Headers

- `Authorization` string

## Response `200`

The resulting collection of Segment records

- object
  - `data` MemberSegment[]
    - `createdAt` string — `public` Date the record was created
    - `isShared` boolean — `public` Indicates if the segment is available to the entire organisation
    - `isTemporary` boolean — `public` Indicates if this segment is only intended to be used for single-use
    - `label` string — `public` A description used to identiy this segment to admins
    - `path` string — `public` The path of this record (for alternative lookup)
    - `rules` SegmentRuleSet — A set of rules applying to this segment
      - `match` 'any' | 'all' — Type of match, all groups or any group
      - `groups` object[] — A list of all of the condition groups to evaluate
        - `conditions` object[] — A list of conditions in a group
          - `type` 'field' | 'relation' | 'segment' | 'tagged' | 'interaction' — The type of condition
          - `relation` 'subscriptions' | 'donations' | 'profiles' — Required if type is relation. Specifies the model to join
          - `segment` string — Required if type is segment. Specifies the Segment UUID to check against
          - `field` string — Required if type is field. Specifies the field name to check
          - `comparison` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'absent' | 'present' — * `eq` - Equal `==` * `neq` - Not equal `!=` * `gt` - Greater than `>` * `gte` - Greater than or equals `>=` * `lt` - Less than `<` * `lte` - Less than or equals `<=` * `absent` - Is unset `!` * `present` - Is set `!!`
          - `value` union — Required if the type is field. The value that this condition will apply itself to
            - string
            - number
          - `tagged` string — Required if type is tagged. Specifies the UUID of the tag to check against.
          - `interaction` string — Required if type is interaction. Specifies the UUID of the interaction to check against.
          - `logicalOperator` 'and' | 'or' | 'and not' — The operator to use to combine this condition to the previous condition in the group
          - `subconditions` object[] — Only relevant if the type is relation. Specifies additional conditions to apply to the joined records.
            - `field` string — Field used to compare against
            - `comparison` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'absent' | 'present' — * `eq` - Equal `==` * `neq` - Not equal `!=` * `gt` - Greater than `>` * `gte` - Greater than or equals `>=` * `lt` - Less than `<` * `lte` - Less than or equals `<=` * `absent` - Is unset `!` * `present` - Is set `!!`
            - `value` union — The value that this condition will apply itself to
              - …
            - `logicalOperator` 'and' | 'or' | 'and not' — The operator to use to combine this subcondition to the previous subcondition
          - `aggregates` object — Required if type is relation. Describes how to aggregate the relation.
            - `subconditions` object[]
              - …
    - `updatedAt` string — `public` Date the record was last updated
    - `uuid` string — `public` Unique identifier for the record
  - `pagination` Pagination
    - `total` integer — The total amount of records returned
    - `pages` integer — The amount of pages (by limit) returned
    - `prevUrl` union — Url that points to the previous set of records in the pagination if available
      - string
      - boolean
    - `nextUrl` union — Url that points to the next set of records in the pagination if available
      - string
      - boolean
    - `offset` integer — The total number of records to offset in the pagination
    - `limit` integer — The maximum amount of records to shown in each page

## Other responses

- `401` — Authorization credentials were missing or invalid
- `403` — The user is authenticated, but is not allowed to perform the requested operation
- `404` — One of the records needed to complete the request could not be found
- `410` — The requested record no longer exists, or that API has been deprecated
- `429` — You have made too many requests to the given endpoint, please try again later
- `500` — An unexpected error has occurred with Raisely. If the error persists you can contact support@raisely.com

---

[API](https://skmtc.dev/raisely/apis/raisely-api.md) · [All operations](https://skmtc.dev/raisely/apis/raisely-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/raisely/raisely-api/revisions/d7f8dd294cb0/schema)
