# Imperva / Incapsula

Rest API Endpoint: `https://captcha.datalabs.net/createTask`

## Creating The Task <a href="#creating-the-task" id="creating-the-task"></a>

```json
POST https://captcha.datalabs.net/createTask
Host: captcha.datalabs.net
Content-Type: application/json

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "AntiImpervaTask",
    "websiteUrl": "https://example.com/",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
    "utmvc": true,
    "reese84": true,
    "reeseScriptUrl": "https://exampe.com/random-words-and-dashes-blah-blah?d=exampe.com",
    "cookies": [
      {
        "name": "cookieName",
        "value": "cookieValue"
      }
    ],
    "proxyType": "http",
    "proxyAddress": "1.1.1.1",
    "proxyPort": "9999",
    "proxyLogin": "username",
    "proxyPassword": "password",
    }
}
```

### Task Parameter Table <a href="#task-parameter-table" id="task-parameter-table"></a>

<table><thead><tr><th width="189">Parameters</th><th width="162.66666666666666">Required</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>true</td><td><em><strong>AntiImpervaTask</strong></em></td></tr><tr><td>websiteURL</td><td>true</td><td>The website address in which you're solving the captcha for.</td></tr><tr><td>userAgent</td><td>false</td><td>Browser user-agent used in emulation.</td></tr><tr><td>utmvc <mark style="color:blue;"><code>(Bool)</code></mark></td><td>false</td><td>If cookie jar contains any of the following cookies, set to true:<br><code>incap_see_xxx</code>, <code>nlbi_xxx</code>, <code>visid_inap_xxx</code></td></tr><tr><td>reese84 <mark style="color:blue;"><code>(Bool)</code></mark></td><td>false</td><td>If cookies contain "reese84", set to true.</td></tr><tr><td>reeseScriptUrl</td><td>false</td><td>This is is a URL that can be found in the network activity. Typically consists of random words separated by dashes.</td></tr><tr><td>cookies</td><td>false</td><td>You can optionally send cookies to the solver.</td></tr><tr><td>proxyType</td><td>true</td><td>The type of proxy, accepts values: <code>http</code>, <code>https</code>, <code>socks4</code>, and <code>socks5</code>.</td></tr><tr><td>proxyAddress</td><td>true</td><td>The IPv4/IPv6 IP for your proxy (Host names, non-transparent, and local network proxies are not allowed)</td></tr><tr><td>proxyPort</td><td>true</td><td>The proxy port</td></tr><tr><td>proxyLogin</td><td>false</td><td>The proxy username</td></tr><tr><td>proxyPassword</td><td>false</td><td>The proxy password</td></tr></tbody></table>

### Task Created Response <a href="#task-created-response" id="task-created-response"></a>

```json
{
  "errorId":0,
  "taskId":997993082
}
```

<table><thead><tr><th width="184">Parameters</th><th width="370">Description</th></tr></thead><tbody><tr><td>errorId</td><td>0: Without error.<br>1: Error with request.</td></tr><tr><td>errorCode</td><td>Short code for error type.</td></tr><tr><td>errorDescription</td><td>More detailed description of the error that occurred.</td></tr><tr><td>taskId</td><td>Task ID, provided for synchronous tasks to be pushed to /getTaskResult</td></tr></tbody></table>

## Retrieving the Solution <a href="#retrieving-the-solution" id="retrieving-the-solution"></a>

```json
POST https://captcha.datalabs.net/getTaskResult
Host: captcha.datalabs.net
Content-Type: application/json

{
  "clientKey": "DATALABS_API_KEY",
  "taskId": "997993082"
}
```

### Successful Solution Response

```json
{
  "errorId":0,
  "status":"ready",
  "solution": {
    "token": "223d1f60-0e9f-4238-ac0a-e766b15a778e:EQoAf0APpGIKAAAA:AJam3OWp..."
  }
}
```

<table><thead><tr><th width="246">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>token</td><td>The succesfully solved solution token.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datalabs.net/captcha-tasks/incapsula-imperva-tasks/imperva-incapsula.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
