Submit an async task

Queue a task to run asynchronously in the background. The response contains a task ID you can poll for the result, or the result can be delivered by webhook.

post/v1/async/task

Request

  • Base URL: https://api.answerline.dev
  • URL: https://api.answerline.dev/v1/async/task
  • Auth: HTTP bearer

Request body

taskType'AIMODE' | 'GOOGLE' | 'GOOGLE_NEWS' | 'GEMINI' | 'CHATGPT' | 'COPILOT' | 'PERPLEXITY' | 'GROK' required

AI provider that should handle this task.

payloadobject required

Request body specific to the provider. Needs at least prompt (query for Google Search).

priorityinteger

Priority of the task, from 1 to 10; tasks with higher numbers run first. Default: 1.

idempotencyKeystring

Distinct string that stops the same task from being created twice. No two tasks in your account may share it.

Example request

{
  "taskType": "CHATGPT",
  "payload": {
    "prompt": "How is Northwind Traders reviewed by customers?",
    "country": "US"
  },
  "priority": 5,
  "idempotencyKey": "batch-chatgpt-001",
  "webhook": {
    "url": "https://your-app.com/webhook-handler"
  }
}

Response

Task created. The response includes its ID and starting status.

successboolean required

Example response

{
  "success": true,
  "task": {
    "id": "b27a21e1-7c39-4aa2-a347-23e828c426f9",
    "taskType": "CHATGPT",
    "status": "QUEUED",
    "priority": 1,
    "createdAt": "2026-04-09T15:00:00.000Z",
    "idempotencyKey": "batch-chatgpt-001"
  },
  "credits": {
    "creditsToCharge": 0.00062
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.