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

# Terminate challenge attempt

Challenges are designed as a set of questions that must be answered in a single attempt,
without the ability to stop and resume it later. In this flow, a challenge attempt should be
terminated immediately if the user leaves the question page.

<Note>
  All attempts that were not closed before the challenge end date will be terminated automatically.
</Note>

To immediately close a challenge attempt for the current API user, execute the `terminateChallengeAttempt` mutation.

<Note>
  Use `extraTimeSpent` parameter to add an extra time (in seconds) to the general time that the current API user spent on the given challenge.
</Note>

<CodeGroup>
  ```filename GraphQL theme={null}
  mutation terminateChallengeAttempt {
    terminateChallengeAttempt(challengeId: 1, extraTimeSpent: 10) {
      errors
      response {
        id
        completedOn
        cta {
          actionId
          title
          arguments {
            key
            value
          }
        }
      }
    }
  }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "terminateChallengeAttempt": {
        "errors": [],
        "response": {
          "id": "15",
          "completedOn": 1771193604,
          "cta": [
            {
              "actionId": "VIEW_CHALLENGE_RESULTS",
              "title": "View full results",
              "arguments": [
                {
                  "key": "challengeId",
                  "value": "1"
                }
              ]
            }
          ]
        },
      }
    }
  }
  ```
</CodeGroup>

## Related Features

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/OpignoEnterpriseAPI/ConsumerUserAuthentication">
    Understand the authentication requirements and how to properly authenticate your requests.
  </Card>
</CardGroup>
