> ## Documentation Index
> Fetch the complete documentation index at: https://developer.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset the Challenge

> Resets the current passkey challenge, allowing a new QR Code to be generated

## Overview

<Warning>
  On some devices, WhatsApp has started requiring an additional verification step when attempting to connect to WhatsApp Web, called **[Passkey](/en/tips/extension-guide)**. Because of this, devices that try to read the QR Code via the API may receive a **Challenge** in return.
</Warning>

This method is part of the instance connection flow via **Passkey (WebAuthn)**. It is used when the client wants to generate a **new** QR Code — for example, to scan it with a different device.

When this endpoint is called, the current challenge is **reset**. On the next call to the **QR Code** endpoint, a new QR Code is generated.

<Note>
  This endpoint invalidates the current passkey flow. After a successful call, the **qr-code** endpoint must be called again to obtain the new QR Code.
</Note>

***

## Attributes

### Required

<ParamField path="instanceId" type="string" required>
  Your instance ID. Available in the Z-API panel under **Instances**.
</ParamField>

<ParamField path="token" type="string" required>
  Your Z-API instance token.
</ParamField>

***

## Response

### 200

Returns the result of the processing by the instance. There are two possible variations:

**Success — challenge reset:**

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{ "success": true }
```

**Failure — unable to restart the instance:**

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{ "success": false, "error": "Failed to restart instance after challenge reset" }
```

<Note>
  On success, call the **qr-code** endpoint again to obtain the new QR Code.
</Note>

### 400

Returned in the following cases:

* **Instance not found** for the `instanceId` + `token` pair:

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{ "error": "Instance not found", "value": null }
```

### 405

In this case, make sure you are sending the correct method specification, i.e., check whether you sent a POST or GET request as specified at the beginning of this topic.

### 415

If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending to the request headers, most commonly "application/json".
