# Create Task \[/createTask]

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

## Request Structure

<table><thead><tr><th width="184">Parameters</th><th width="109">Required</th><th width="370">Description</th></tr></thead><tbody><tr><td>clientKey</td><td>true</td><td>Your accounts private API Key.</td></tr><tr><td>task</td><td>true</td><td>Contains all of the task info for the to-be-solved captcha.</td></tr><tr><td>callbackUrl</td><td>false</td><td>Optional callback url for solution results.</td></tr></tbody></table>

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

{
  "clientKey": "DATALABS_API_KEY",
  "task": {
    "type": "RecaptchaV2TaskProxyless",
    "websiteURL": "https://google.com/recaptcha/api2/demo",
    "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
  },
  "callbackUrl": "https://example.com/callback"
}
```

## Response Structure

<table><thead><tr><th width="184">Parameters</th><th width="720">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>taskId</td><td>Task ID, provided for synchronous tasks to be pushed to /getTaskResult</td></tr></tbody></table>

## Example Responses

```json
{
    "errorId": 1,
    "errorCode": "ERROR_NO_SUCH_METHOD",
    "errorDescription": "Invalid type"
}
```

```json
{
    "errorId": 0,
    "taskId": "12341234-1234-1234-1234-123412341234"
}
```
