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

# Restart a training

A training can be restarted only in two cases:

1. A new revision has been published.
2. A certificate that was acquired for the training is expired.

If a training can be restarted, an [`infoMessage`](/OpignoEnterprise/InfoMessage) object will be returned under `LearningPath`:

<CodeGroup>
  ```GraphQL GraphQL theme={null}
  query getLearningPath {
    getLearningPath(lpId: 40) {
      infoMessage {
        type
        title
        description
        status
        cta {
          title
          actionId
          arguments {
            key
            value
          }
        }
      }
    }
  }
  ```

  ```Query Query result [expandable] theme={null}
  {
    "data": {
      "getLearningPath": {
        "infoMessage": [
          {
            "type": "NEW_VERSION_AVAILABLE",
            "title": "New version available",
            "description": "A new version of this training is available, you can restart now with the latest version or continue with you current version.",
            "status": "STATUS",
            "cta": [
              {
                "title": "Restart training",
                "actionId": "CREATE_LP_ATTEMPT",
                "arguments": [
                  {
                    "key": "lpId",
                    "value": "40"
                  }
                  {
                    "key": "forceNew",
                    "value": true
                  }
                ],
              }
            ]
          }
        ]
      }
    }
  }
  ```
</CodeGroup>

## `createLpAttempt` mutation

To restart a training, [`createLpAttempt`](/OpignoEnterpriseAPI/CreateLearningPathAttempt#create-learning-path-attempt) mutation should be executed.
The list of arguments will be returned in `cta` object under [`infoMessage`](/OpignoEnterpriseAPI/InfoMessage).

The mutation accepts the following arguments:

| Parameter  | Type      | Description                                                                                                                        |
| :--------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------- |
| `lpId`     | `ID`      | **Required**. ID of the learning path that should be restarted.                                                                    |
| `forceNew` | `Boolean` | **Should be set to `true`**. Indicates whether a new attempt should be forcibly created, even if an active attempt already exists. |

<CodeGroup>
  ```GraphQL Mutation theme={null}
    mutation createLpAttempt {
      createLpAttempt(lpId: 40, forceNew: true) {
        response {
          cta {
          actionId
          arguments {
            key
            value
          }
        }
      }
    }
  }
  ```

  ```Query Mutation result [expandable] theme={null}
  {
    "data": {
      "createLpAttempt": {
        "response": {
          "cta": [
            {
              "actionId": "TAKE_EDGE",
              "arguments": [
                {
                  "key": "lpId",
                  "value": "40"
                },
                {
                  "key": "lpAttemptContextId",
                  "value": "4478"
                },
                {
                  "key": "edgeRid",
                  "value": "762"
                }
              ]
            }
          ]
        }
      }
    }
  }
  ```
</CodeGroup>
