curl -X POST https://agentgate.mynewapi.com/v1/work-orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"taskPrompt": "Add input validation to the user registration endpoint",
"workspaceSource": {
"type": "git",
"repository": "https://github.com/your-org/your-repo",
"branch": "main"
},
"maxIterations": 5,
"tenantContext": {
"tenantId": "acme-corp",
"tenantUserId": "user_123"
}
}'
{
"workOrderId": "wo_abc123xyz",
"runId": "run_def456uvw",
"status": "pending",
"createdAt": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits to submit work order",
"details": {
"estimatedCost": 500,
"availableCredits": 200
}
}
}
Work Orders
Create Work Order
Create a new work order to execute an automated task
POST
/
v1
/
work-orders
curl -X POST https://agentgate.mynewapi.com/v1/work-orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"taskPrompt": "Add input validation to the user registration endpoint",
"workspaceSource": {
"type": "git",
"repository": "https://github.com/your-org/your-repo",
"branch": "main"
},
"maxIterations": 5,
"tenantContext": {
"tenantId": "acme-corp",
"tenantUserId": "user_123"
}
}'
{
"workOrderId": "wo_abc123xyz",
"runId": "run_def456uvw",
"status": "pending",
"createdAt": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits to submit work order",
"details": {
"estimatedCost": 500,
"availableCredits": 200
}
}
}
string
required
Description of the task to accomplish. Be specific and include context.
object
required
Source for the workspace files.
Show Git Source
Show Git Source
integer
default:10
Maximum number of iterations before failing.
object
Verification configuration.
string
URL to receive completion webhook.
object
object
Custom metadata to attach to the work order.
string
Unique identifier for the work order.
string
Unique identifier for the created run.
string
Initial status (always
pending).string
ISO 8601 timestamp of creation.
curl -X POST https://agentgate.mynewapi.com/v1/work-orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"taskPrompt": "Add input validation to the user registration endpoint",
"workspaceSource": {
"type": "git",
"repository": "https://github.com/your-org/your-repo",
"branch": "main"
},
"maxIterations": 5,
"tenantContext": {
"tenantId": "acme-corp",
"tenantUserId": "user_123"
}
}'
{
"workOrderId": "wo_abc123xyz",
"runId": "run_def456uvw",
"status": "pending",
"createdAt": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits to submit work order",
"details": {
"estimatedCost": 500,
"availableCredits": 200
}
}
}