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

# Assign taxonomy term to hierarchy level

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

To assign a taxonomy term to a specific hierarchy level, use the `assignTaxonomyTermToLevel` mutation.

**Access policy:**

* The API user context must have permission to manage taxonomy term assignments.
* The specified `taxonomyTermId` must exist and be accessible.
* The specified `hierarchyLevelId` must exist and be accessible.

The mutation accepts the following arguments:

| Argument           | Type | Description                                                                            | Default |
| :----------------- | :--- | :------------------------------------------------------------------------------------- | :------ |
| `taxonomyTermId`   | `ID` | Required. The unique identifier of the taxonomy term to assign.                        | —       |
| `hierarchyLevelId` | `ID` | Required. The unique identifier of the hierarchy level to assign the taxonomy term to. | —       |

<Note>
  This operation creates a relationship between a taxonomy term and a hierarchy level, which can be used for categorization and filtering purposes.
</Note>

<CodeGroup>
  ```filename GraphQL [expandable] theme={null}
  mutation assignTaxonomyTermToLevel {
    assignTaxonomyTermToLevel(
      taxonomyTermId: 9
      hierarchyLevelId: 1
    ) {
      errors
      response
    }
  }
  ```

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