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

# Claim skills

Some skills do not require completing a training to be considered acquired. A skill
assigned with the `ACCESSORY` criticality can be self-declared as claimed by the
learner directly, or approved from a submitted CV.

## Claim a skill directly

To claim a skill, `claimSkill` mutation should be executed.

| Argument  | Type | Description                                                |
| :-------- | :--- | :--------------------------------------------------------- |
| `skillId` | `ID` | **Required.** ID of the skill term that should be claimed. |

A skill can only be claimed if all the following conditions are met:

* The skill is assigned to the current API user context as a target skill (individually,
  or as a part of a skills profile), with its criticality set to `ACCESSORY`.
* All of its sub-skills, if any, are already acquired or claimed.
* All of its prerequisites, if any, are already acquired or claimed.

Here is an example of the mutation execution:

<CodeGroup>
  ```filename GraphQL theme={null}
  mutation claimSkill {
    claimSkill(skillId: 7) {
      errors
      response {
        skill {
          name
        }
        acquisitionStatus
        acquisitionSource
        acquiredOn
      }
    }
  }
  ```

  ```File Mutation result [expandable] theme={null}
  {
    "data": {
      "claimSkill": {
        "errors": [],
        "response": {
          "skill": {
            "name": "Promoting"
          },
          "acquisitionStatus": "CLAIMED",
          "acquisitionSource": "CLAIMED",
          "acquiredOn": 1782918513
        }
      }
    }
  }
  ```
</CodeGroup>

If the skill cannot be claimed (wrong criticality, unmet sub-skills or prerequisites),
`errors` will contain the corresponding violation.

### `UserSkillResponse` API object

| Parameter  | Type          | Description                                                                                                                                        |
| :--------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| `errors`   | `[Violation]` | Validation errors or violations encountered during the process.                                                                                    |
| `response` | `UserSkill`   | The related [`UserSkill`](/OpignoEnterpriseAPI/Skills/AcquiredSkills#userskill-api-object) object, if the request was executed without any errors. |

## Request a CV skills review

A learner can also submit a CV together with a list of skills they believe it
demonstrates. A manager then reviews the CV and confirms which of the suggested skills
are approved. Once confirmed, an approved skill appears as claimed for the related user
context, with the acquisition source `CV_APPROVAL`.

To submit a CV for review, `requestCvSkillsReview` mutation should be executed.

| Argument   | Type                                                                                 | Description                                                                      |
| :--------- | :----------------------------------------------------------------------------------- | :------------------------------------------------------------------------------- |
| `cvBase64` | [`UploadedFileInput`](/OpignoEnterpriseAPI/Post/CreatePost#uploadedfileinput-object) | **Required.** The CV file. Max file size — 20 Mb. Allowed extensions — pdf.      |
| `skillIds` | `[ID!]`                                                                              | **Required.** IDs of the skill terms that should be confirmed during the review. |

Here is an example of the mutation execution:

<CodeGroup>
  ```filename GraphQL theme={null}
  mutation requestCvSkillsReview {
    requestCvSkillsReview(
      cvBase64: {
        filename: "cv.pdf"
        contentBase64: "JVBERi0xLjQKJcOkw7zDtsO...="
      }
      skillIds: [4, 7]
    ) {
      errors
      response {
        id
        skills {
          name
        }
      }
    }
  }
  ```

  ```File Mutation result [expandable] theme={null}
  {
    "data": {
      "requestCvSkillsReview": {
        "errors": [],
        "response": {
          "id": "20",
          "skills": [
            {
              "name": "Communication"
            },
            {
              "name": "Promoting"
            }
          ]
        }
      }
    }
  }
  ```
</CodeGroup>

### `CvSkillsReview` API object

| Parameter | Type                                                                                     | Description                                                                        |
| :-------- | :--------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| `cv`      | `MediaFile`                                                                              | **Required**. The submitted CV file.                                               |
| `id`      | `ID`                                                                                     | **Required**. ID of the CV skills review entity.                                   |
| `skills`  | [`TaxonomyTerm`](/OpignoEnterpriseAPI/Taxonomy/GetTaxonomyTerm#taxonomy-term-api-object) | **Optional**. The list of skills that correspond to the CV and should be reviewed. |

### `CvSkillsReviewResponse` API object

| Parameter  | Type             | Description                                                                                                         |
| :--------- | :--------------- | :------------------------------------------------------------------------------------------------------------------ |
| `errors`   | `[Violation]`    | **Optional**. Validation errors or violations encountered during the process.                                       |
| `response` | `CvSkillsReview` | **Optional**. The created `CvSkillsReview` object, described above, if the request was executed without any errors. |
