NetStacksNetStacks

Tasks API

Scheduled task management endpoints.

List Tasks

GET /api/tasks
Authorization: Bearer <token>

Response:
{
  "data": [
    {
      "id": "uuid",
      "name": "daily-backup",
      "task_type": "backup",
      "schedule": "0 2 * * *",
      "enabled": true,
      "next_run": "2024-01-16T02:00:00Z"
    }
  ]
}

Create Task

POST /api/tasks
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "daily-backup",
  "task_type": "backup",
  "schedule": "0 2 * * *",
  "timezone": "America/New_York",
  "device_ids": ["uuid1", "uuid2"],
  "config": {
    "config_type": "running"
  }
}

Response: 201 Created

Task Executions

GET /api/tasks/:id/executions
Authorization: Bearer <token>

Response:
{
  "data": [
    {
      "id": "uuid",
      "task_id": "uuid",
      "status": "completed",
      "started_at": "2024-01-15T02:00:00Z",
      "completed_at": "2024-01-15T02:05:00Z",
      "results": [...]
    }
  ]
}