> ## 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.

# restoreSegment

> Restores an archived segment and matches cards again in the background. Returns the segment in `INITIALIZING`; follow `status` until `ACTIVE`. `ConflictError`: the segment isn't archived; `NotFoundError`: it doesn't exist.



**mutation** `restoreSegment(input: RestoreSegmentInput!): RestoreSegmentPayload!`

## Arguments

**`input`**: `RestoreSegmentInput!` (required)

## Returns

`RestoreSegmentPayload!`

**`errors`**: `[RestoreSegmentError!]`

---

**`segment`**: `Segment`

## Examples

```graphql Mutation
mutation RestoreSegment($input: RestoreSegmentInput!) {
  restoreSegment(input: $input) {
    errors {
      __typename
      ... on GraphQlError {
        code
        details {
          __typename
        }
        message
      }
    }
    segment {
      cardDefinition {
        activationStatus {
          __typename
        }
        activePropertySet {
          __typename
        }
        allowsEnrichment
        cardsCount
        createdAt
        createdByUser
      }
      cardDefinitionId
      colorHex
      createdAt
      createdByUser
      description
    }
  }
}
```

```json Variables
{
  "input": {
    "id": "id"
  }
}
```

```json Response
{
  "data": {
    "restoreSegment": {
      "errors": [
        {
          "__typename": "GraphQlError",
          "code": "string",
          "details": [
            {
              "__typename": "KeyValuePairOfStringAndString"
            }
          ],
          "message": "string"
        }
      ],
      "segment": {
        "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"
      }
    }
  }
}
```


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