Get AI Automation Task

Retrieves the current state of an AI automation task. Use it to check whether a task is still running, or has reached a terminal state of completed, failed, or cancelled.

Required Permissions

Requires the MEMBER role or higher.

HTTP Request

GET /api/sonar/ai/automation/tasks/:task_id
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     https://HOSTNAME/api/sonar/ai/automation/tasks/a1b2c3d4-e5f6-7890-abcd-ef1234567890
Request Parameters
Path Parameters
KeyTypeDescriptionNotes
task_idStringAI automation task identifier36 characters

Success Response

{
  "task": {
    "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "command": "sonar-ai-generate-parser",
    "callback": "sonar-ai-generate-parser-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "running"
  }
}
  • task (Map): AI automation task information
    • task_id (String): Task identifier
    • command (String): Task command type. One of sonar-ai-generate-parser, sonar-ai-fix-parser, or sonar-ai-generate-dashboard
    • callback (String): Push callback channel name for progress events. Formed by joining command, -, and the task identifier
    • status (String): Task status. One of running, completed, failed, or cancelled

Error Responses

task_id is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "task_id should be not null"
}
task_id is not a valid GUID

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "task_id should be guid type."
}
Task does not exist

HTTP status code 500

{
  "error_code": "invalid-argument",
  "error_msg": "Task not found: a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}