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

# Skills management

Opigno Enterprise provides a *Skills* feature for tracking learners' knowledge levels,
identifying skill gaps, and recommending personalized training.

To get the list of all skills available for the current API user, `getAllSkills` should be used.

| Parameter | Type      | Description                                                                                                                              | Default |
| :-------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------- | :------ |
| `after`   | `Cursor`  | Returns results that come after the specified cursor. Should be used together with `first` parameter. Cannot be used if `before` is set. | —       |
| `before`  | `Cursor`  | Returns results that come before the specified cursor. Should be used together with `last` parameter. Cannot be used if `after` is set.  | —       |
| `first`   | `Integer` | Returns up to the first N elements from the list. Required if `after` parameter is set. Cannot be used together with `last`.             | —       |
| `last`    | `Integer` | Returns up to the first N elements from the list. Required if `before` parameter is set. Cannot be used together with `first`.           | —       |
| `reverse` | `Boolean` | Allows to reverse the order of the query results list (default order is by a skill taxonomy term title, **ascending**).                  | `false` |
| `title`   | `String`  | Optional filter by a skill taxonomy term title. Works with `CONTAINS` operator.                                                          | —       |

The query returns a paginated list of `TaxonomyTerm` objects.

Here is an example of the query execution:

<CodeGroup>
  ```filename GraphQL All skills theme={null}
  query getAllSkills {
    getAllSkills(first: 3) {
      edges {
        node {
          id
          name
          weight
        }
      }
      totalItems
    }
  }
  ```

  ```File Query All skills result [expandable] theme={null}
  {
    "data": {
      "getAllSkills": {
        "edges": [
          {
            "node": {
              "id": "4",
              "name": "Communication"
              "weight": 2
            }
          },
          {
            "node": {
              "id": "1",
              "name": "Creativity",
              "weight": 1
            }
          },
          {
            "node": {
              "id": "3",
              "name": "Management"
              "weight": 3
            }
          }
        ],
        "totalItems": 15
      }
    }
  }
  ```
</CodeGroup>

## Manage learner's target skills

Target skills can be defined for user contexts by users with `ADMINISTRATOR` scope.

To assign a target skill to a learner, `assignTargetSkill` mutation should be executed;
to remove a skill from the list of target ones for the user context, `removeTargetSkill` mutation should be used.

Both mutations accept two **required** arguments:

| Argument          | Type | Description                                                                                                   |
| :---------------- | :--- | :------------------------------------------------------------------------------------------------------------ |
| `skillId`         | `ID` | ID of the skill taxonomy term that should be assigned (or removed) as a target one to the given user context. |
| `userContextUuid` | `ID` | UUID of the user context to assign (or remove) the target skill.                                              |

Here is an example of the mutation execution:

<CodeGroup>
  ```filename GraphQL Assign target skill mutation theme={null}
  mutation assignTargetSkill {
    assignTargetSkill(skillId: 2, userContextUuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890") {
      errors
      response
    }
  }
  ```

  ```File Assign target skill mutation result [expandable] theme={null}
  {
    "data": {
      "errors": {
        "errors": [],
        "response": true
      }
    }
  }
  ```
</CodeGroup>

If the mutation executed without any errors, a boolean value will be returned as a response, indicating the success status.

To remove a skill from the list of target ones for the user context, `removeTargetSkill` mutation should be executed.

## Related Features

Skills are basically taxonomy terms, they can be created using UI in the backoffice or with Opigno Enterprise API:

<CardGroup cols={2}>
  <Card title="Taxonomy terms API" icon="arrow-right" href="/OpignoEnterpriseAPI/Taxonomy/TaxonomyAPI">
    Check how to create, update or delete taxonomy terms using API.
  </Card>

  <Card title="Pagination" icon="arrow-right" href="/OpignoEnterpriseAPI/PaginatingCatalogItems">
    Learn how to efficiently navigate through large sets of items using cursor-based pagination.
  </Card>
</CardGroup>
