> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vast.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Create task

# Create Task

Creates a new captcha solving task and returns a task ID that can be used to retrieve the result.

## API Endpoint

```
POST /createTask
```

## Request Parameters

<ParamField body="clientKey" type="string" required>
  Your API key.
</ParamField>

<ParamField body="task" type="object" required>
  An object containing task-specific parameters.
</ParamField>

<ParamField body="task.type" type="string" required>
  The type of captcha task to solve. Possible values include:

  * `RecaptchaV2Task` - Regular reCAPTCHA v2
  * `RecaptchaV3Task` - reCAPTCHA v3
  * `HCaptchaTask` - hCaptcha (standard and enterprise; set `enterprise` to `true` for enterprise sites)
  * `TurnstileTask` - Cloudflare Turnstile
  * `FunCaptchaTask` - FunCaptcha (Arkose Labs)
  * `ImageToTextTask` - Image-based captcha
</ParamField>

<ParamField body="task.websiteURL" type="string" required>
  The URL of the page where the captcha is located.
</ParamField>

<ParamField body="task.websiteKey" type="string" required>
  The site key of the captcha from the target website.
</ParamField>

<ParamField body="task.isInvisible" type="boolean">
  Set to `true` if the reCAPTCHA is invisible. Only applicable for RecaptchaV2Task.
</ParamField>

<ParamField body="task.minScore" type="number">
  Minimum score required for reCAPTCHA v3. Only applicable for RecaptchaV3Task.
</ParamField>

<ParamField body="task.pageAction" type="string">
  Action name used for reCAPTCHA v3. Only applicable for RecaptchaV3Task.
</ParamField>

<ParamField body="task.userAgent" type="string">
  The User-Agent header that will be used in solving the captcha.
</ParamField>

<ParamField body="task.proxy" type="string">
  Proxy in format `login:password@ip_address:port`.
</ParamField>

<ParamField body="task.invisible" type="boolean">
  Set to `true` if the hCaptcha is invisible. Default is `false`.
</ParamField>

<ParamField body="task.enterprise" type="boolean">
  Set to `true` for enterprise hCaptcha (Discord, Epic Games, TikTok, etc). Default is `false`.
</ParamField>

## Response

<ResponseField name="taskId" type="string">
  The unique identifier of the created task. Used to retrieve the task result.
</ResponseField>

## Example Request - reCAPTCHA v2

```bash theme={null}
curl -X POST https://captcha.vast.sh/api/solver/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "RecaptchaV2Task",
      "websiteURL": "https://example.com/recaptcha",
      "websiteKey": "6LcR_TAUAAAAAMtflUgIXnBu1ldPGo8YlHXKA0fy",
      "isInvisible": false
    }
  }'
```

## Example Request - hCaptcha (Standard)

```bash theme={null}
curl -X POST https://captcha.vast.sh/api/solver/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "HCaptchaTask",
      "websiteURL": "https://modrinth.com",
      "websiteKey": "4a7a2c80-68f2-4190-9d52-131c76e0c14e",
      "proxy": "user:pass@ip:port"
    }
  }'
```

## Example Request - hCaptcha (Enterprise)

```bash theme={null}
curl -X POST https://captcha.vast.sh/api/solver/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "HCaptchaTask",
      "websiteURL": "https://discord.com/register",
      "websiteKey": "a9b5fb07-92ff-493f-86fe-352a2803b3df",
      "proxy": "user:pass@ip:port",
      "enterprise": true,
    }
  }'
```

## Example Response

```json theme={null}
{
  "taskId": "9d55c404-5a45-4e7b-8a93-b8ed9f26bdcf",
  "error": null
}
```

## Error Codes

<ResponseField name="error" type="object">
  Error details when the request fails.
</ResponseField>

<ResponseField name="error.errorId" type="integer">
  Error ID.
</ResponseField>

<ResponseField name="error.errorCode" type="string">
  Error code identifier.
</ResponseField>

<ResponseField name="error.errorDescription" type="string">
  Human-readable error description.
</ResponseField>

Common error codes:

* `ERROR_KEY_DOES_NOT_EXIST` - Invalid API key
* `ERROR_INSUFFICIENT_BALANCE` - Not enough balance
* `ERROR_VALIDATION_FAILED` - Invalid request parameters
* `ERROR_NO_SLOT_AVAILABLE` - No available slots for task processing
* `ERROR_IP_BANNED` - IP address banned

## Notes

* The task will be processed asynchronously. Use the returned `taskId` with the [Get Task Result](/api-reference/tasks/get-task-result) endpoint to retrieve the solution.
* Different captcha types require different parameters. Refer to the documentation for specific captcha types for details.
* For hCaptcha (standard and enterprise), use `HCaptchaTask` and set `enterprise` to `true` for enterprise sites.
* Proxy usage is recommended for geo-restricted captchas or to improve success rates.
