Skip to content

Developer portal

POST /optimize

Submit a schedule, route, or staffing problem and receive a ranked plan with summary, metrics, and method details.

GAPOST /optimizeAuth required

Summary

Submit a schedule, route, or staffing problem and receive a ranked plan with summary, metrics, and method details.

Rate limit: 120 requests per minute per API key (default)

Example

curl

curl -X POST "https://sparkling-vibrancy-production-1a7a.up.railway.app/optimize" \
  -H "Authorization: Bearer 811f31d4-5b8e-4ed0-a7a2-8176e05eba63" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "schedule",
  "tasks": [
    {
      "id": "A",
      "duration": 3
    },
    {
      "id": "B",
      "duration": 2
    }
  ],
  "constraints": [
    "A must happen before B"
  ]
}'

Try it live

Request body

FieldTypeRequiredDescription
typestringYes

Problem family: schedule, scheduling (alias), routing, or allocation.

e.g. schedule

tasks[]ScheduleTaskInput[]No

Work items for scheduling problems.

e.g. { "id": "A", "duration": 3, "crew": "Crew A" }

constraints[]string[]No

Hard rules the plan must satisfy (dependencies, blocked windows).

e.g. "A must happen before B"

stops[]RoutingStopInput[]No

Stops for routing problems.

e.g. { "id": "hospital", "serviceWindow": "08:30-10:00" }

vehicles[]VehicleInput[]No

Fleet units and capacity for routing.

shifts[]ShiftInput[]No

Shifts to cover for allocation problems.

staff[]StaffInput[]No

People, skills, and hour limits for allocation.

dataobjectNo

Extension bag for forward-compatible fields.

e.g. {}

Response

FieldTypeRequiredDescription
status"success"Yes

Job completed with a feasible plan.

summarystringYes

Plain-English explanation for operators.

solutionarray | objectYes

Executable plan: task timeline, route assignments, or staffing grid.

metricsobjectYes

constraintViolations, savingsEstimate, and problem-specific KPIs.

method"classical" | "hybrid"Yes

Honest solver path label.

detailsobjectYes

solver, backend, and diagnostics for engineering review.

visualizationobject | nullNo

Optional UI-friendly timeline or grid payload.

Errors

CodeMeaningTypical causeSuggested fix
401UnauthorizedMissing or invalid API key in Authorization or x-api-key header.Send Bearer <key> or x-api-key with a valid pilot token.
422Unprocessable entityInvalid payload shape, unsupported problem type, or infeasible constraints.Fix field errors in the response detail; relax constraints and retry.
429Too many requestsPer-key rate limit exceeded (default 120 requests per minute).Backoff with jitter; cache results; request a higher limit for production.
500Internal server errorUnexpected backend failure.Retry with exponential backoff; contact support if persistent.
501Not implementedProblem type not yet supported on the live solver path (routing, allocation).Use type schedule for live jobs, or follow the roadmap for routing/allocation.

See the full errors reference.