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

Skills profiles can be created, updated, published, unpublished and deleted with Opigno Enterprise API,
in addition to the backoffice UI. Once a profile is published, it can be
[assigned to learners](https://docs.opigno.com/OpignoEnterpriseAPI/Skills/SkillsProfiles.md#assign-a-skills-profile-to-user-context).

> [!NOTE]
>
> The mutations described on this page are are available only in Corporate tariff plan.

All mutations require the current API user context to be associated with the `ADMINISTRATOR` scope.
Otherwise, an access denied violation will be returned in `errors`.

## `SkillsProfileResponse` API object

The response returned by the skills profile mutations that create or change a profile.

| Parameter | Type | Description |
| :- | :- | :- |
| `errors` | `[Violation]` | **Optional**. Validation errors or violations encountered during the process. |
| `response` | `SkillsProfile` | **Optional**. The related [`SkillsProfile`](https://docs.opigno.com/OpignoEnterpriseAPI/Skills/SkillsProfiles#skillsprofile-api-object) object, if the request was executed without any errors. |

## `ProfileSkillInput` API object

Represents an input for a single skill item of a skills profile.

| Parameter | Type | Description |
| :- | :- | :- |
| `criticality` | [`TargetSkillCriticality`](https://docs.opigno.com/OpignoEnterpriseAPI/Skills/SkillsManagement#targetskillcriticality-api-object) | **Required**. The skill criticality in scope of the profile: `ESSENTIAL`, `IMPORTANT`, or `ACCESSORY`. |
| `skillId` | `ID` | **Required**. ID of the top-level skill term that should be added to the profile. |

The list of profile skills should meet the following requirements:

* All skill terms should exist on the site and be accessible for the current API user context.
* Only top-level skills can be added to a profile.
* Every skill can be added to a profile only once.
* All prerequisites of the selected skills should be added to the profile as well.

## Title and description values

The same rules are applied to the skills profile title and description in all mutations:

* **Title** is a plain text, 255 characters max. All html tags will be stripped, and if the title is longer than
  255 characters, it will be trimmed. A title that becomes empty after the tags are stripped will be rejected.
* **Description** allows the following HTML tags: `<br>`, `<p>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`, `<h6>`, `<strong>`,
  `<em>`, `<u>`, `<s>`, `<sub>`, `<sup>`, `<a href>`, `<ul>`, `<ol start>`, `<li>`. All other tags and attributes
  will be stripped. The description should contain a text: a value with only HTML tags or whitespaces will be rejected.

## Create a skills profile

To create a new skills profile, `createSkillsProfile` mutation should be executed.

| Argument | Type | Description | Default |
| :- | :- | :- | :- |
| `description` | `String` | **Required.** The skills profile description. See [the allowed values](#title-and-description-values). | — |
| `published` | `Boolean` | Defines if the skills profile should be published right after creation. | `false` |
| `skills` | [`[ProfileSkillInput!]`](#profileskillinput-api-object) | **Required.** The list of skills with their criticality in scope of the profile. | — |
| `title` | `String` | **Required.** The skills profile title. See [the allowed values](#title-and-description-values). | — |

The mutation returns a [`SkillsProfileResponse`](#skillsprofileresponse-api-object) object.

```filename GraphQL Create skills profile mutation theme={null}
mutation createSkillsProfile {
  createSkillsProfile(
    title: "Team Lead"
    description: "<p>Skills required to lead a <strong>development team</strong>.</p>"
    skills: [
      {
        skillId: 4
        criticality: ESSENTIAL
      },
      {
        skillId: 7
        criticality: IMPORTANT
      }
    ]
    published: true
  ) {
    errors
    response {
      id
      title
      description
      skills {
        skill {
          name
        }
        criticality
      }
    }
  }
}
```

```File Create skills profile mutation result [expandable] theme={null}
{
  "data": {
    "createSkillsProfile": {
      "errors": [],
      "response": {
        "id": "12",
        "title": "Team Lead",
        "description": "<p>Skills required to lead a <strong>development team</strong>.</p>",
        "skills": [
          {
            "skill": {
              "name": "Management"
            },
            "criticality": "ESSENTIAL"
          },
          {
            "skill": {
              "name": "Communication"
            },
            "criticality": "IMPORTANT"
          }
        ]
      }
    }
  }
}
```

If any of the values is not valid, the profile will not be created, and `errors` will contain the corresponding violations:

```File Create skills profile mutation result with errors [expandable] theme={null}
{
  "data": {
    "createSkillsProfile": {
      "errors": [
        "Skill with ID 99 does not exist or is not accessible for the current API user."
      ],
      "response": null
    }
  }
}
```

## Update a skills profile

To update an existing skills profile, `updateSkillsProfile` mutation should be executed.

The mutation works as a partial update: only the values that should be changed need to be sent.
Omitted or `null` arguments keep their current values, but at least one value to update should be provided.

| Argument | Type | Description |
| :- | :- | :- |
| `description` | `String` | The new skills profile description. See [the allowed values](#title-and-description-values). |
| `skills` | [`[ProfileSkillInput!]`](#profileskillinput-api-object) | The new list of skills with their criticality. **Replaces** all current profile skills, so the full list should be sent. |
| `skillsProfileId` | `ID` | **Required.** ID of the skills profile that should be updated. |
| `title` | `String` | The new skills profile title. See [the allowed values](#title-and-description-values). |

The skills profile with the given ID should exist and be editable by the current API user context.
The mutation returns a [`SkillsProfileResponse`](#skillsprofileresponse-api-object) object with the updated profile.

```filename GraphQL Update skills profile mutation theme={null}
mutation updateSkillsProfile {
  updateSkillsProfile(
    skillsProfileId: 12
    title: "Senior Team Lead"
  ) {
    errors
    response {
      id
      title
    }
  }
}
```

```File Update skills profile mutation result [expandable] theme={null}
{
  "data": {
    "updateSkillsProfile": {
      "errors": [],
      "response": {
        "id": "12",
        "title": "Senior Team Lead"
      }
    }
  }
}
```

## Publish a skills profile

To publish a skills profile, `publishSkillsProfile` mutation should be executed.

| Argument | Type | Description |
| :- | :- | :- |
| `skillsProfileId` | `ID` | **Required.** ID of the skills profile that should be published. |

Only an unpublished skills profile can be published.
The mutation returns a [`SkillsProfileResponse`](#skillsprofileresponse-api-object) object with the updated profile.

```filename GraphQL Publish skills profile mutation theme={null}
mutation publishSkillsProfile {
  publishSkillsProfile(skillsProfileId: 12) {
    errors
    response {
      id
      title
    }
  }
}
```

```File Publish skills profile mutation result [expandable] theme={null}
{
  "data": {
    "publishSkillsProfile": {
      "errors": [],
      "response": {
        "id": "12",
        "title": "Senior Team Lead"
      }
    }
  }
}
```

## Unpublish a skills profile

To unpublish a skills profile, `unpublishSkillsProfile` mutation should be executed.

| Argument | Type | Description |
| :- | :- | :- |
| `skillsProfileId` | `ID` | **Required.** ID of the skills profile that should be unpublished. |

Only a published skills profile can be unpublished.
The mutation returns a [`SkillsProfileResponse`](#skillsprofileresponse-api-object) object with the updated profile.

> [!NOTE]
>
> A skills profile that is assigned to at least one user context cannot be unpublished.

```filename GraphQL Unpublish skills profile mutation theme={null}
mutation unpublishSkillsProfile {
  unpublishSkillsProfile(skillsProfileId: 12) {
    errors
    response {
      id
      title
    }
  }
}
```

```File Unpublish skills profile mutation result [expandable] theme={null}
{
  "data": {
    "unpublishSkillsProfile": {
      "errors": [],
      "response": {
        "id": "12",
        "title": "Senior Team Lead"
      }
    }
  }
}
```

## Delete a skills profile

To delete a skills profile, `deleteSkillsProfile` mutation should be executed.

| Argument | Type | Description |
| :- | :- | :- |
| `skillsProfileId` | `ID` | **Required.** ID of the skills profile that should be deleted. |

> [!NOTE]
>
> A skills profile that is assigned to at least one user context cannot be deleted.
> Remove it from all user contexts first.

```filename GraphQL Delete skills profile mutation theme={null}
mutation deleteSkillsProfile {
  deleteSkillsProfile(skillsProfileId: 12) {
    errors
    response
  }
}
```

```File Delete skills profile mutation result [expandable] theme={null}
{
  "data": {
    "deleteSkillsProfile": {
      "errors": [],
      "response": true
    }
  }
}
```

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

## Related Features

> [card] [Skills profiles](https://docs.opigno.com/OpignoEnterpriseAPI/Skills/SkillsProfiles.md)
>
> Check how to get the list of skills profiles and assign them to learners.

> [card] [Taxonomy terms API](https://docs.opigno.com/OpignoEnterpriseAPI/Taxonomy/TaxonomyAPI.md)
>
> Check how to create, update or delete skill terms using API.


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