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

# Unassign training from hierarchy level

<Warning>
  Only users with the <b>ADMINISTRATOR</b> scope in the current context can unassign trainings from hierarchy levels. Make sure your API token grants administrator privileges.
  See [Understanding Scopes](/OpignoEnterpriseAPI/UserContextManagement#understanding-scopes) for more information.
</Warning>

To remove a training assignment from a specific hierarchy level, use the `unassignTrainingFromLevel` mutation.

**Access policy:**

* The API user context must have permission to manage training assignments.
* The specified `trainingId` must exist and be accessible.
* The specified `hierarchyLevelId` must exist and be accessible.

The mutation accepts the following arguments:

| Argument           | Type | Description                                                                           | Default |
| :----------------- | :--- | :------------------------------------------------------------------------------------ | :------ |
| `trainingId`       | `ID` | Required. The unique identifier of the training to unassign.                          | —       |
| `hierarchyLevelId` | `ID` | Required. The unique identifier of the hierarchy level to unassign the training from. | —       |

<Note>
  This operation removes the relationship between a training and a hierarchy level, making the training no longer available to users assigned to that level.
</Note>

<CodeGroup>
  ```filename GraphQL [expandable] theme={null}
  mutation unassignTrainingFromLevel {
    unassignTrainingFromLevel(
      trainingId: 4
      hierarchyLevelId: 1
    ) {
      errors
      response
    }
  }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "unassignTrainingFromLevel": {
        "errors": [],
        "response": true
      }
    }
  }
  ```
</CodeGroup>
