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

A skills profile is a reusable set of target skills, each with its own criticality, that
can be assigned to a learner in a single operation instead of assigning every skill individually.

<Note>
  Only one skills profile can be associated with a user context.
</Note>

## `SkillsProfile` API object

The general representation of a skill profile entity.
The object is used for a query to get the list of all available profiles that can be assigned to learners.

| Parameter | Type                                         | Description                                              |
| :-------- | :------------------------------------------- | :------------------------------------------------------- |
| `id`      | `ID`                                         | **Required**. The skills profile ID.                     |
| `skills`  | [`[ProfileSkill]`](#profileskill-api-object) | **Required**. The related skills with their criticality. |
| `title`   | `String`                                     | **Required**. The title of the skills profile.           |

### `ProfileSkill` API object

Represents a single skill data in scope of a profile.

| Parameter     | Type                                                                                                       | Description                                         |
| :------------ | :--------------------------------------------------------------------------------------------------------- | :-------------------------------------------------- |
| `criticality` | [`TargetSkillCriticality`](/OpignoEnterpriseAPI/Skills/SkillsManagement#targetskillcriticality-api-object) | **Required**. The skill criticality in the profile. |
| `skill`       | [`TaxonomyTerm`](/OpignoEnterpriseAPI/Taxonomy/GetTaxonomyTerm#taxonomy-term-api-object)                   | **Required**. The skill taxonomy term.              |

## `UserSkillsProfile` API object

Represents the skills profile assigned to a user context.

| Parameter           | Type                                                                                              | Description                                                                       |
| :------------------ | :------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------- |
| `id`                | `ID`                                                                                              | **Required**. The skills profile ID.                                              |
| `lastAcquiredSkill` | [`TargetSkill`](/OpignoEnterpriseAPI/Skills/SkillsManagement#targetskillcriticality-api-object)   | **Optional**. The profile skill most recently acquired by the user context.       |
| `metrics`           | [`UserSkillsProfileMetrics`](#userskillsprofilemetrics-api-object)                                | **Optional**. Statistics about the profile completion for the user context.       |
| `progress`          | `Int`                                                                                             | **Optional**. Profile completion progress for the user context.                   |
| `skills`            | [`[TargetSkill]`](/OpignoEnterpriseAPI/Skills/SkillsManagement#targetskillcriticality-api-object) | **Required**. The related skills with their criticality.                          |
| `suggestedSkill`    | [`TargetSkill`](/OpignoEnterpriseAPI/Skills/SkillsManagement#targetskillcriticality-api-object)   | **Optional**. The most relevant unlocked, not yet acquired skill to work on next. |
| `title`             | `String`                                                                                          | **Required**. The title of the skills profile.                                    |

### `UserSkillsProfileMetrics` API object

Represents statistics related to the skills profile completion by a given user context.

| Parameter               | Type  | Description                                                                             |
| :---------------------- | :---- | :-------------------------------------------------------------------------------------- |
| `acquiredSkillCount`    | `Int` | The number of profile skills acquired by the user context.                              |
| `availableSkillCount`   | `Int` | The number of profile skills that are unlocked and not yet acquired or claimed.         |
| `claimedSkillCount`     | `Int` | The number of profile skills claimed as acquired by the user context.                   |
| `inProgressSkillCount`  | `Int` | The number of profile skills with a progress strictly between 0% and 100%.              |
| `lockedSkillCount`      | `Int` | The number of profile skills that are locked and cannot be acquired for the moment.     |
| `notAcquiredSkillCount` | `Int` | The number of profile skills that are neither acquired nor claimed by the user context. |

## Get all skills profiles

To get the list of all skills profiles available on the site, `getAllSkillsProfiles`
query should be executed.

| 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 **ascending**).                                                  | `false` |
| `title`   | `String`  | Optional filter by a skills profile title.                                                                                               | —       |

The query returns a paginated list of [`SkillsProfile`](#skillsprofile-api-object) objects.

<CodeGroup>
  ```filename GraphQL theme={null}
  query getAllSkillsProfiles {
    getAllSkillsProfiles(first: 1) {
      edges {
        node {
          id
          title
          skills {
            skill {
              name
            }
            criticality
          }
        }
      }
      totalItems
    }
  }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "getAllSkillsProfiles": {
        "edges": [
          {
            "node": {
              "id": "10",
              "title": "Team Lead",
              "skills": [
                {
                  "skill": {
                    "name": "Management"
                  },
                  "criticality": "ESSENTIAL"
                },
                {
                  "skill": {
                    "name": "Communication"
                  },
                  "criticality": "IMPORTANT"
                }
              ]
            }
          }
        ],
        "totalItems": 4
      }
    }
  }
  ```
</CodeGroup>

## Assign a skills profile to user context

To assign a skills profile to a user context, `assignUserSkillsProfile` mutation should
be executed. Only one profile can be assigned per user context; assigning a new one
replaces the previous one.

| Argument          | Type | Description                                                             |
| :---------------- | :--- | :---------------------------------------------------------------------- |
| `skillsProfileId` | `ID` | **Required.** ID of the skills profile that should be assigned.         |
| `userContextUuid` | `ID` | **Required.** UUID of the user context to assign the skills profile to. |

<CodeGroup>
  ```filename GraphQL theme={null}
  mutation assignUserSkillsProfile {
    assignUserSkillsProfile(
      skillsProfileId: 10
      userContextUuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    ) {
      errors
      response
    }
  }
  ```

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

## Remove assigned skills profile from user context

To remove the skills profile assigned to a user context, `removeUserSkillsProfile`
mutation should be executed.

| Argument          | Type | Description                                                                        |
| :---------------- | :--- | :--------------------------------------------------------------------------------- |
| `userContextUuid` | `ID` | **Required.** UUID of the user context to remove the assigned skills profile from. |

<CodeGroup>
  ```filename GraphQL theme={null}
  mutation removeUserSkillsProfile {
    removeUserSkillsProfile(userContextUuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890") {
      errors
      response
    }
  }
  ```

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

## Get the skills profile of a user context

To get the skills profile currently assigned to a user context, `getUserContextSkillsProfile`
query should be executed.

| Parameter         | Type | Description                                                                                              |
| :---------------- | :--- | :------------------------------------------------------------------------------------------------------- |
| `userContextUuid` | `ID` | UUID of the user context to get the skills profile for. If empty, current API user context will be used. |

The query returns a [`UserSkillsProfile`](#userskillsprofile-api-object) object if a profile is assigned.

<CodeGroup>
  ```filename GraphQL theme={null}
  query getUserContextSkillsProfile {
    getUserContextSkillsProfile(userContextUuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890") {
      id
      title
      progress
      metrics {
        acquiredSkillCount
        claimedSkillCount
        notAcquiredSkillCount
        lockedSkillCount
        availableSkillCount
        inProgressSkillCount
      }
      suggestedSkill {
        name
      }
      lastAcquiredSkill {
        name
      }
    }
  }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "getUserContextSkillsProfile": {
        "id": "10",
        "title": "Team Lead",
        "progress": 62,
        "metrics": {
          "acquiredSkillCount": 3,
          "claimedSkillCount": 1,
          "notAcquiredSkillCount": 2,
          "lockedSkillCount": 1,
          "availableSkillCount": 1,
          "inProgressSkillCount": 1
        },
        "suggestedSkill": {
          "name": "Communication"
        },
        "lastAcquiredSkill": {
          "name": "Project Management"
        }
      }
    }
  }
  ```
</CodeGroup>

## Related Features

<CardGroup cols={2}>
  <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>
