Skip to main content
GET
https://agentgate.mynewapi.com
/
api
/
v1
/
work-orders
List Work Orders
curl --request GET \
  --url https://agentgate.mynewapi.com/api/v1/work-orders \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "<string>",
        "taskPrompt": "<string>",
        "status": "<string>",
        "workspaceSource": {
          "type": "<string>",
          "path": "<string>",
          "repo": "<string>",
          "branch": "<string>"
        },
        "agentType": "<string>",
        "createdAt": "<string>",
        "updatedAt": "<string>",
        "runCount": 123
      }
    ],
    "total": 123,
    "limit": 123,
    "offset": 123,
    "hasMore": true
  }
}

List Work Orders

Returns a paginated list of work orders with optional status filtering.

Request

status
string
Filter by work order status. One of: queued, running, waiting_for_children, integrating, succeeded, failed, canceled
limit
number
default:"20"
Maximum number of results to return (1-100)
offset
number
default:"0"
Number of results to skip for pagination
curl "https://agentgate.mynewapi.com/api/v1/work-orders?status=running&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Paginated work order list

Example Response

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "wo_abc123",
        "taskPrompt": "Add input validation to login form",
        "status": "running",
        "workspaceSource": {
          "type": "github",
          "repo": "myorg/frontend",
          "branch": "main"
        },
        "agentType": "claude-code-subscription",
        "createdAt": "2024-01-15T10:30:00.000Z",
        "updatedAt": "2024-01-15T10:35:00.000Z",
        "runCount": 1
      },
      {
        "id": "wo_def456",
        "taskPrompt": "Fix authentication bug",
        "status": "running",
        "workspaceSource": {
          "type": "github",
          "repo": "myorg/backend",
          "branch": "develop"
        },
        "agentType": "claude-code-subscription",
        "createdAt": "2024-01-15T09:00:00.000Z",
        "updatedAt": "2024-01-15T10:30:00.000Z",
        "runCount": 2
      }
    ],
    "total": 45,
    "limit": 10,
    "offset": 0,
    "hasMore": true
  },
  "requestId": "req_xyz789"
}

Status Values

StatusDescription
queuedWaiting to be processed
runningCurrently being executed
waiting_for_childrenWaiting for sub-tasks to complete
integratingMerging results
succeededCompleted successfully
failedExecution failed
canceledCanceled by user

Pagination Example

# First page
curl "https://agentgate.mynewapi.com/api/v1/work-orders?limit=20&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Second page
curl "https://agentgate.mynewapi.com/api/v1/work-orders?limit=20&offset=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Filter by Status

# Get only running work orders
curl "https://agentgate.mynewapi.com/api/v1/work-orders?status=running" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get only failed work orders
curl "https://agentgate.mynewapi.com/api/v1/work-orders?status=failed&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"