Skip to main content
GET
https://agentgate.mynewapi.com
/
api
/
v1
/
work-orders
/
{id}
/
audit
Get Work Order Audit
curl --request GET \
  --url https://agentgate.mynewapi.com/api/v1/work-orders/{id}/audit \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "workOrderId": "<string>",
    "runs": [
      {
        "runId": "<string>",
        "iteration": 123,
        "startedAt": "<string>",
        "configHash": "<string>",
        "changesCount": 123
      }
    ]
  }
}

Get Work Order Audit

Returns the audit trail for a work order, showing configuration snapshots and changes across all runs.

Request

id
string
required
The work order ID (e.g., wo_abc123)
curl https://agentgate.mynewapi.com/api/v1/work-orders/wo_abc123/audit \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Audit information

Example Response

{
  "success": true,
  "data": {
    "workOrderId": "wo_abc123",
    "runs": [
      {
        "runId": "run_001",
        "iteration": 5,
        "startedAt": "2024-01-15T10:30:00.000Z",
        "configHash": "sha256:abc123def456...",
        "changesCount": 2
      },
      {
        "runId": "run_002",
        "iteration": 3,
        "startedAt": "2024-01-15T11:00:00.000Z",
        "configHash": "sha256:abc123def456...",
        "changesCount": 0
      }
    ]
  },
  "requestId": "req_xyz789"
}

Error Responses

Work Order Not Found

{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Work order not found: wo_invalid"
  },
  "requestId": "req_xyz789"
}

Use Cases

  • Debugging: Understand configuration changes that affected run behavior
  • Compliance: Audit trail for configuration changes
  • Analysis: Track which configurations lead to successful runs

Detailed Audit Information

For detailed audit information about a specific run, use the dedicated audit endpoints:
# Get detailed audit for a specific run
curl https://agentgate.mynewapi.com/api/v1/audit/runs/run_001 \
  -H "Authorization: Bearer YOUR_API_KEY"