{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/answerline-dev/json-schema/answerline-dev-batch-task-request-schema.json",
  "title": "BatchTaskRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/answerline-dev-async-api-openapi.yml#/components/schemas/BatchTaskRequest",
  "type": "object",
  "required": [
    "taskType",
    "payload"
  ],
  "properties": {
    "taskType": {
      "type": "string",
      "enum": [
        "AIMODE",
        "GOOGLE",
        "GOOGLE_NEWS",
        "GEMINI",
        "CHATGPT",
        "COPILOT",
        "PERPLEXITY",
        "GROK"
      ],
      "description": "Engine that should handle this task."
    },
    "payload": {
      "type": "object",
      "description": "Request body specific to the engine. Needs at least `prompt` (`query` for Google Search)."
    },
    "priority": {
      "type": "integer",
      "description": "Priority of the task, from 1 to 10; tasks with higher numbers run first. Default: 1.",
      "minimum": 1,
      "maximum": 10,
      "default": 1
    },
    "idempotencyKey": {
      "type": "string",
      "description": "Distinct string that stops the same task from being created twice. No two tasks in your account may share it: the key stays bound while its task is kept (4 to 5 days), and a failed task frees it 24 hours after failing."
    },
    "webhook": {
      "type": "object",
      "description": "Settings for the webhook that reports a finished task.",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Endpoint that gets the webhook POST request once the task finishes."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}