# Request fields

> Set every field of a task request: the engine, the prompt, the country, US state or city, your brand and competitors, and what the result includes.

The body of `POST /v1/tasks`, `POST /v1/sync/task` and each batch item has the same shape: a `taskType`, a `payload` for the engine, and a few options.

## Top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `taskType` | string | Engine to run. Required. Case-insensitive. See [Engines](https://promptgale.com/docs/engines.md). |
| `payload` | object | Engine input, below. Required. |
| `webhookUrl` | string (url) | Called with the finished task. Optional. Must be a public https URL. |
| `idempotencyKey` | string | Up to 256 characters. Optional; same as the `Idempotency-Key` header. |
| `priority` | integer 0..10 | Higher runs first within your account. Default 0. |

## Answer engines

| Field | Type | Description |
| --- | --- | --- |
| `prompt` | string | 1 to 4000 characters. Required. |
| `country` | ISO2 | Market to ask from. Default US. See [Countries and locations](https://promptgale.com/docs/locations.md). |
| `brand` | string | Your brand. Turns on the analysis block. |
| `brandAliases` | string[] | Other names that count as the brand. |
| `brandDomains` | string[] | Domains that count as citing the brand. |
| `competitors` | string[] | Brands to compare against, up to 50. |
| `include` | object | Booleans: `markdown` (default true), `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. `analysis` runs the full answer analysis with sentiment, with or without a brand. `html` saves an [evidence page](https://promptgale.com/docs/evidence.md). |

## Example

```json
{
  "taskType": "CHATGPT",
  "payload": {
    "prompt": "best crm for a small agency",
    "country": "US",
    "brand": "Acme",
    "competitors": ["Globex", "Initech"],
    "include": { "analysis": true }
  },
  "priority": 0
}
```

A field the engine does not take, or a value out of range, answers `400` `VALIDATION_ERROR` with the path of each problem in `error.details`.

---

Docs index: https://promptgale.com/llms.txt · Full reference: https://promptgale.com/llms-full.txt · OpenAPI: https://promptgale.com/v1/openapi.json
