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

# segments

> Lists the tenant's segments, archived ones included.



**query** `segments(after: String, before: String, first: Int, last: Int, order: [SegmentSortInput!], where: SegmentFilterInput): SegmentsConnection`

## Arguments

**`after`**: `String`

Returns the elements in the list that come after the specified cursor.

---

**`before`**: `String`

Returns the elements in the list that come before the specified cursor.

---

**`first`**: `Int`

Returns the first _n_ elements from the list.

---

**`last`**: `Int`

Returns the last _n_ elements from the list.

---

**`order`**: `[SegmentSortInput!]`

---

**`where`**: `SegmentFilterInput`

## Returns

`SegmentsConnection`

**`edges`**: `[SegmentsEdge!]`

A list of edges.

---

**`nodes`**: `[Segment!]`

A flattened list of the nodes.

---

**`pageInfo`**: `PageInfo!`

Information to aid in pagination.

---

**`totalCount`**: `Int!`

Identifies the total count of items in the connection.

## Examples

```graphql Query
query Segments {
  segments {
    edges {
      cursor
      node {
        cardDefinition {
          __typename
        }
        cardDefinitionId
        colorHex
        createdAt
        createdByUser
        description
      }
    }
    nodes {
      cardDefinition {
        activationStatus {
          __typename
        }
        activePropertySet {
          __typename
        }
        allowsEnrichment
        cardsCount
        createdAt
        createdByUser
      }
      cardDefinitionId
      colorHex
      createdAt
      createdByUser
      description
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
```

```json Response
{
  "data": {
    "segments": {
      "edges": [
        {
          "cursor": "string",
          "node": {
            "cardDefinition": {
              "__typename": "CardDefinition"
            },
            "cardDefinitionId": "id",
            "colorHex": "string",
            "createdAt": "value",
            "createdByUser": "value",
            "description": "string"
          }
        }
      ],
      "nodes": [
        {
          "cardDefinition": {
            "activationStatus": {
              "__typename": "WorkflowStatus"
            },
            "activePropertySet": {
              "__typename": "PropertySet"
            },
            "allowsEnrichment": true,
            "cardsCount": "value",
            "createdAt": "value",
            "createdByUser": "value"
          },
          "cardDefinitionId": "id",
          "colorHex": "string",
          "createdAt": "value",
          "createdByUser": "value",
          "description": "string"
        }
      ],
      "pageInfo": {
        "endCursor": "string",
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "string"
      },
      "totalCount": 1
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.