{
  "openapi": "3.1.0",
  "info": {
    "title": "Engine API",
    "version": "3.0.0",
    "description": "Create and operate jobs: the nodes a bot visits, the actions at each node, packages, hooks and events."
  },
  "servers": [
    {
      "url": "https://api.remi.robot.com/api/v3"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Jobs",
      "description": "Create, read, edit and delete jobs: a sequence of stops (nodes) for a bot, each with actions."
    },
    {
      "name": "Job lifecycle",
      "description": "Move a job through its states and decide which bot works on it."
    },
    {
      "name": "Nodes",
      "description": "The stops of a job."
    },
    {
      "name": "Actions",
      "description": "What happens at a node, such as loading or unloading a package."
    },
    {
      "name": "Packages",
      "description": "The packages a job carries."
    },
    {
      "name": "Hooks",
      "description": "Calls a webhook, or runs another action, when job events match its filters."
    },
    {
      "name": "Events",
      "description": "The history of what happened to a job."
    },
    {
      "name": "Alerts",
      "description": "Problems raised on a job."
    },
    {
      "name": "Bots",
      "description": "Control a bot directly: its door and its screen."
    }
  ],
  "paths": {
    "/engine/jobs/overview": {
      "get": {
        "operationId": "getJobsOverview",
        "tags": [
          "Jobs"
        ],
        "summary": "Count jobs by state",
        "description": "Totals for your namespace. `completedLast24h` and `failedLast24h` count jobs that reached that state in the last 24 hours.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "locations",
            "in": "query",
            "required": false,
            "description": "Comma-separated location ids. Only jobs at these locations.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobsOverviewResponse"
                },
                "example": {
                  "data": {
                    "total": 1280,
                    "active": 12,
                    "draft": 1,
                    "scheduled": 2,
                    "pending": 3,
                    "in_progress": 5,
                    "paused": 1,
                    "completed": 1240,
                    "failed": 9,
                    "canceled": 19,
                    "completedLast24h": 87,
                    "failedLast24h": 1
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs": {
      "get": {
        "operationId": "listJobs",
        "tags": [
          "Jobs"
        ],
        "summary": "List jobs",
        "description": "Newest first by default. Send `next_cursor.id` as `cursor_id` and `next_cursor.createdAt` as `cursor_created_at` to get the next page. `next_cursor` is null on the last page.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "locations",
            "in": "query",
            "required": false,
            "description": "Comma-separated location ids. Only jobs at these locations.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "`true`: draft, scheduled, pending, in progress and paused jobs. `false`: completed, failed and canceled jobs.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 1000. Default 100.",
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "cursor_id",
            "in": "query",
            "required": false,
            "description": "`next_cursor.id` of the previous page. Send it with `cursor_created_at`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor_created_at",
            "in": "query",
            "required": false,
            "description": "`next_cursor.createdAt` of the previous page. Send it with `cursor_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "By creation time. Default `desc`.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListJobsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "ES-5867",
                      "namespace": "partner_example",
                      "externalId": "order-4821",
                      "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                      "version": 4,
                      "name": "Order #4821",
                      "description": null,
                      "pictureURL": null,
                      "assignation": "auto",
                      "start": "auto",
                      "state": "in_progress",
                      "currentNodeIndex": 0,
                      "priority": 0,
                      "expendable": false,
                      "createdManually": false,
                      "scheduledAt": null,
                      "targetCompletionAt": null,
                      "startedAt": "2026-06-17T15:43:10.000Z",
                      "finalizedAt": null,
                      "botId": "4T001",
                      "requiresBot": true,
                      "requiredBotTags": null,
                      "createdAt": "2026-06-17T15:42:00.000Z",
                      "updatedAt": "2026-06-17T15:43:10.000Z",
                      "tags": null,
                      "metadata": null,
                      "nodes": [
                        {
                          "jobId": "ES-5867",
                          "name": "pickup",
                          "description": null,
                          "pictureURL": null,
                          "index": 0,
                          "pointId": "V1StGXR8Z5jdHi6BmyT2q",
                          "lat": 4.6512,
                          "lng": -74.0689,
                          "azimuth": null,
                          "positionIndex": 0,
                          "hasPositionDefined": true,
                          "distance": 1240,
                          "travelDuration": 480000,
                          "actionsDuration": 120000,
                          "totalDuration": 600000,
                          "estimatedArrivalAt": "2026-06-17T15:51:00.000Z",
                          "startedAt": "2026-06-17T15:43:10.000Z",
                          "departedAt": "2026-06-17T15:43:10.000Z",
                          "arrivedAt": null,
                          "finalizedAt": null,
                          "state": "in_progress",
                          "transitState": "in_transit",
                          "allowFailure": false,
                          "expendable": false,
                          "tags": null,
                          "released": true,
                          "metadata": null,
                          "actions": [
                            {
                              "jobId": "ES-5867",
                              "nodeName": "pickup",
                              "name": "load",
                              "index": 0,
                              "type": "load",
                              "blockingType": "hard",
                              "state": "pending",
                              "allowFailure": false,
                              "packageName": "pkg-1",
                              "bundleName": null,
                              "metadata": null,
                              "startedAt": null,
                              "finalizedAt": null,
                              "duration": 120000,
                              "createdAt": "2026-06-17T15:42:00.000Z",
                              "updatedAt": null
                            }
                          ]
                        },
                        {
                          "jobId": "ES-5867",
                          "name": "dropoff",
                          "description": null,
                          "pictureURL": null,
                          "index": 1,
                          "pointId": null,
                          "lat": 4.6602,
                          "lng": -74.0521,
                          "azimuth": null,
                          "positionIndex": 1,
                          "hasPositionDefined": true,
                          "distance": 0,
                          "travelDuration": 1500000,
                          "actionsDuration": 60000,
                          "totalDuration": 1560000,
                          "estimatedArrivalAt": "2026-06-17T16:12:00.000Z",
                          "startedAt": null,
                          "departedAt": null,
                          "arrivedAt": null,
                          "finalizedAt": null,
                          "state": "pending",
                          "transitState": null,
                          "allowFailure": false,
                          "expendable": false,
                          "tags": null,
                          "released": true,
                          "metadata": null,
                          "actions": [
                            {
                              "jobId": "ES-5867",
                              "nodeName": "dropoff",
                              "name": "unload",
                              "index": 0,
                              "type": "unload",
                              "blockingType": "hard",
                              "state": "pending",
                              "allowFailure": false,
                              "packageName": "pkg-1",
                              "bundleName": null,
                              "metadata": null,
                              "startedAt": null,
                              "finalizedAt": null,
                              "duration": 60000,
                              "createdAt": "2026-06-17T15:42:00.000Z",
                              "updatedAt": null
                            }
                          ]
                        }
                      ],
                      "packages": [
                        {
                          "jobId": "ES-5867",
                          "name": "pkg-1",
                          "bundleName": null,
                          "description": null,
                          "pictureURL": null,
                          "items": [
                            {
                              "name": "Cheeseburger",
                              "quantity": 1
                            }
                          ],
                          "metadata": null,
                          "station": "Burger Shop",
                          "createdAt": "2026-06-17T15:42:00.000Z"
                        }
                      ]
                    }
                  ],
                  "pagination": {
                    "next_cursor": {
                      "id": "ES-5867",
                      "createdAt": "2026-06-17T15:42:00.000Z"
                    },
                    "limit": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, for example `limit` above 1000.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid query, for example `limit` above 1000."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "createJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Create a job",
        "description": "Creates the job with its nodes, actions, packages and hooks in one call.\n\n- `namespace` must be your key namespace.\n- The response may come before the travel estimates of the nodes are calculated. Get the job again to read them.\n- To schedule it, send `state: scheduled` with `scheduledAt`.",
        "x-scope": "engine",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJobRequest"
              },
              "example": {
                "namespace": "partner_example",
                "externalId": "order-4821",
                "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                "name": "Order #4821",
                "nodes": [
                  {
                    "name": "pickup",
                    "pointId": "V1StGXR8Z5jdHi6BmyT2q",
                    "actions": [
                      {
                        "name": "load",
                        "type": "load",
                        "packageName": "pkg-1"
                      }
                    ]
                  },
                  {
                    "name": "dropoff",
                    "lat": 4.6602,
                    "lng": -74.0521,
                    "actions": [
                      {
                        "name": "unload",
                        "type": "unload",
                        "packageName": "pkg-1"
                      }
                    ]
                  }
                ],
                "packages": [
                  {
                    "name": "pkg-1",
                    "station": "Burger Shop",
                    "items": [
                      {
                        "name": "Cheeseburger",
                        "quantity": 1
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                },
                "example": {
                  "data": {
                    "id": "ES-5867",
                    "namespace": "partner_example",
                    "externalId": "order-4821",
                    "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                    "version": 1,
                    "name": "Order #4821",
                    "description": null,
                    "pictureURL": null,
                    "assignation": "auto",
                    "start": "auto",
                    "state": "pending",
                    "currentNodeIndex": null,
                    "priority": 0,
                    "expendable": false,
                    "createdManually": false,
                    "scheduledAt": null,
                    "targetCompletionAt": null,
                    "startedAt": null,
                    "finalizedAt": null,
                    "botId": null,
                    "requiresBot": true,
                    "requiredBotTags": null,
                    "createdAt": "2026-06-17T15:42:00.000Z",
                    "updatedAt": null,
                    "tags": null,
                    "metadata": null,
                    "nodes": [
                      {
                        "jobId": "ES-5867",
                        "name": "pickup",
                        "description": null,
                        "pictureURL": null,
                        "index": 0,
                        "pointId": "V1StGXR8Z5jdHi6BmyT2q",
                        "lat": 4.6512,
                        "lng": -74.0689,
                        "azimuth": null,
                        "positionIndex": 0,
                        "hasPositionDefined": true,
                        "distance": 1240,
                        "travelDuration": 480000,
                        "actionsDuration": 120000,
                        "totalDuration": 600000,
                        "estimatedArrivalAt": "2026-06-17T15:51:00.000Z",
                        "startedAt": null,
                        "departedAt": null,
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "pending",
                        "transitState": null,
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "pickup",
                            "name": "load",
                            "index": 0,
                            "type": "load",
                            "blockingType": "hard",
                            "state": "pending",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": null,
                            "duration": 120000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      },
                      {
                        "jobId": "ES-5867",
                        "name": "dropoff",
                        "description": null,
                        "pictureURL": null,
                        "index": 1,
                        "pointId": null,
                        "lat": 4.6602,
                        "lng": -74.0521,
                        "azimuth": null,
                        "positionIndex": 1,
                        "hasPositionDefined": true,
                        "distance": 0,
                        "travelDuration": 1500000,
                        "actionsDuration": 60000,
                        "totalDuration": 1560000,
                        "estimatedArrivalAt": "2026-06-17T16:12:00.000Z",
                        "startedAt": null,
                        "departedAt": null,
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "pending",
                        "transitState": null,
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "dropoff",
                            "name": "unload",
                            "index": 0,
                            "type": "unload",
                            "blockingType": "hard",
                            "state": "pending",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": null,
                            "duration": 60000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      }
                    ],
                    "packages": [
                      {
                        "jobId": "ES-5867",
                        "name": "pkg-1",
                        "bundleName": null,
                        "description": null,
                        "pictureURL": null,
                        "items": [
                          {
                            "name": "Cheeseburger",
                            "quantity": 1
                          }
                        ],
                        "metadata": null,
                        "station": "Burger Shop",
                        "createdAt": "2026-06-17T15:42:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`HOOK_ACTION_NOT_ALLOWED`: `action` is not `call_webhook`, or `target` is not an `http(s)` URL.\n\n`POINT_NOT_FOUND`: A node `pointId` is not a point of the job location.\n\n`BOTLESS_JOB_CANNOT_HAVE_BOT`: `requiresBot` is false together with `botId` or `requireAvailableBot`.\n\n`BOTLESS_JOB_MUST_BE_MANUAL_ASSIGNATION`: `requiresBot` is false and `assignation` is not `manual`.\n\n`STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD`: A load action without `packageName` covers packages of more than one station.\n\n`INVALID_BOT`: `botId` does not exist or is at another location.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "HOOK_ACTION_NOT_ALLOWED",
                "when": "`action` is not `call_webhook`, or `target` is not an `http(s)` URL."
              },
              {
                "code": "POINT_NOT_FOUND",
                "when": "A node `pointId` is not a point of the job location."
              },
              {
                "code": "BOTLESS_JOB_CANNOT_HAVE_BOT",
                "when": "`requiresBot` is false together with `botId` or `requireAvailableBot`."
              },
              {
                "code": "BOTLESS_JOB_MUST_BE_MANUAL_ASSIGNATION",
                "when": "`requiresBot` is false and `assignation` is not `manual`."
              },
              {
                "code": "STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD",
                "when": "A load action without `packageName` covers packages of more than one station."
              },
              {
                "code": "INVALID_BOT",
                "when": "`botId` does not exist or is at another location."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.\n\n`namespace` is not your key namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              },
              {
                "when": "`namespace` is not your key namespace."
              }
            ]
          },
          "409": {
            "description": "`NO_AVAILABLE_BOT`: With `requireAvailableBot` and no `botId`: no bot is available.\n\n`BOT_UNAVAILABLE`: `botId` is retired, off duty, not connected, or belongs to another partner.\n\n`BOT_BUSY`: `state` is `in_progress` and `botId` is on another job.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "NO_AVAILABLE_BOT",
                "when": "With `requireAvailableBot` and no `botId`: no bot is available."
              },
              {
                "code": "BOT_UNAVAILABLE",
                "when": "`botId` is retired, off duty, not connected, or belongs to another partner."
              },
              {
                "code": "BOT_BUSY",
                "when": "`state` is `in_progress` and `botId` is on another job."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/by-bot/{botId}": {
      "get": {
        "operationId": "getJobByBot",
        "tags": [
          "Jobs"
        ],
        "summary": "Get the active job of a bot",
        "description": "The in-progress or paused job of the bot. `data` is null when the bot has none.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "botId",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_hooks",
            "in": "query",
            "required": false,
            "description": "`true` to include the job hooks.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "include_events",
            "in": "query",
            "required": false,
            "description": "`true` to include the job events.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "include_alerts",
            "in": "query",
            "required": false,
            "description": "`true` to include the job alerts.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobByBotResponse"
                },
                "example": {
                  "data": {
                    "id": "ES-5867",
                    "namespace": "partner_example",
                    "externalId": "order-4821",
                    "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                    "version": 4,
                    "name": "Order #4821",
                    "description": null,
                    "pictureURL": null,
                    "assignation": "auto",
                    "start": "auto",
                    "state": "in_progress",
                    "currentNodeIndex": 0,
                    "priority": 0,
                    "expendable": false,
                    "createdManually": false,
                    "scheduledAt": null,
                    "targetCompletionAt": null,
                    "startedAt": "2026-06-17T15:43:10.000Z",
                    "finalizedAt": null,
                    "botId": "4T001",
                    "requiresBot": true,
                    "requiredBotTags": null,
                    "createdAt": "2026-06-17T15:42:00.000Z",
                    "updatedAt": "2026-06-17T15:43:10.000Z",
                    "tags": null,
                    "metadata": null,
                    "nodes": [
                      {
                        "jobId": "ES-5867",
                        "name": "pickup",
                        "description": null,
                        "pictureURL": null,
                        "index": 0,
                        "pointId": "V1StGXR8Z5jdHi6BmyT2q",
                        "lat": 4.6512,
                        "lng": -74.0689,
                        "azimuth": null,
                        "positionIndex": 0,
                        "hasPositionDefined": true,
                        "distance": 1240,
                        "travelDuration": 480000,
                        "actionsDuration": 120000,
                        "totalDuration": 600000,
                        "estimatedArrivalAt": "2026-06-17T15:51:00.000Z",
                        "startedAt": "2026-06-17T15:43:10.000Z",
                        "departedAt": "2026-06-17T15:43:10.000Z",
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "in_progress",
                        "transitState": "in_transit",
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "pickup",
                            "name": "load",
                            "index": 0,
                            "type": "load",
                            "blockingType": "hard",
                            "state": "pending",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": null,
                            "duration": 120000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      },
                      {
                        "jobId": "ES-5867",
                        "name": "dropoff",
                        "description": null,
                        "pictureURL": null,
                        "index": 1,
                        "pointId": null,
                        "lat": 4.6602,
                        "lng": -74.0521,
                        "azimuth": null,
                        "positionIndex": 1,
                        "hasPositionDefined": true,
                        "distance": 0,
                        "travelDuration": 1500000,
                        "actionsDuration": 60000,
                        "totalDuration": 1560000,
                        "estimatedArrivalAt": "2026-06-17T16:12:00.000Z",
                        "startedAt": null,
                        "departedAt": null,
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "pending",
                        "transitState": null,
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "dropoff",
                            "name": "unload",
                            "index": 0,
                            "type": "unload",
                            "blockingType": "hard",
                            "state": "pending",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": null,
                            "duration": 60000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      }
                    ],
                    "packages": [
                      {
                        "jobId": "ES-5867",
                        "name": "pkg-1",
                        "bundleName": null,
                        "description": null,
                        "pictureURL": null,
                        "items": [
                          {
                            "name": "Cheeseburger",
                            "quantity": 1
                          }
                        ],
                        "metadata": null,
                        "station": "Burger Shop",
                        "createdAt": "2026-06-17T15:42:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Get a job",
        "description": "Includes nodes, actions and packages.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_hooks",
            "in": "query",
            "required": false,
            "description": "`true` to include the job hooks.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "include_events",
            "in": "query",
            "required": false,
            "description": "`true` to include the job events.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "include_alerts",
            "in": "query",
            "required": false,
            "description": "`true` to include the job alerts.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                },
                "example": {
                  "data": {
                    "id": "ES-5867",
                    "namespace": "partner_example",
                    "externalId": "order-4821",
                    "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                    "version": 4,
                    "name": "Order #4821",
                    "description": null,
                    "pictureURL": null,
                    "assignation": "auto",
                    "start": "auto",
                    "state": "in_progress",
                    "currentNodeIndex": 0,
                    "priority": 0,
                    "expendable": false,
                    "createdManually": false,
                    "scheduledAt": null,
                    "targetCompletionAt": null,
                    "startedAt": "2026-06-17T15:43:10.000Z",
                    "finalizedAt": null,
                    "botId": "4T001",
                    "requiresBot": true,
                    "requiredBotTags": null,
                    "createdAt": "2026-06-17T15:42:00.000Z",
                    "updatedAt": "2026-06-17T15:43:10.000Z",
                    "tags": null,
                    "metadata": null,
                    "nodes": [
                      {
                        "jobId": "ES-5867",
                        "name": "pickup",
                        "description": null,
                        "pictureURL": null,
                        "index": 0,
                        "pointId": "V1StGXR8Z5jdHi6BmyT2q",
                        "lat": 4.6512,
                        "lng": -74.0689,
                        "azimuth": null,
                        "positionIndex": 0,
                        "hasPositionDefined": true,
                        "distance": 1240,
                        "travelDuration": 480000,
                        "actionsDuration": 120000,
                        "totalDuration": 600000,
                        "estimatedArrivalAt": "2026-06-17T15:51:00.000Z",
                        "startedAt": "2026-06-17T15:43:10.000Z",
                        "departedAt": "2026-06-17T15:43:10.000Z",
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "in_progress",
                        "transitState": "in_transit",
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "pickup",
                            "name": "load",
                            "index": 0,
                            "type": "load",
                            "blockingType": "hard",
                            "state": "pending",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": null,
                            "duration": 120000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      },
                      {
                        "jobId": "ES-5867",
                        "name": "dropoff",
                        "description": null,
                        "pictureURL": null,
                        "index": 1,
                        "pointId": null,
                        "lat": 4.6602,
                        "lng": -74.0521,
                        "azimuth": null,
                        "positionIndex": 1,
                        "hasPositionDefined": true,
                        "distance": 0,
                        "travelDuration": 1500000,
                        "actionsDuration": 60000,
                        "totalDuration": 1560000,
                        "estimatedArrivalAt": "2026-06-17T16:12:00.000Z",
                        "startedAt": null,
                        "departedAt": null,
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "pending",
                        "transitState": null,
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "dropoff",
                            "name": "unload",
                            "index": 0,
                            "type": "unload",
                            "blockingType": "hard",
                            "state": "pending",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": null,
                            "duration": 60000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      }
                    ],
                    "packages": [
                      {
                        "jobId": "ES-5867",
                        "name": "pkg-1",
                        "bundleName": null,
                        "description": null,
                        "pictureURL": null,
                        "items": [
                          {
                            "name": "Cheeseburger",
                            "quantity": 1
                          }
                        ],
                        "metadata": null,
                        "station": "Burger Shop",
                        "createdAt": "2026-06-17T15:42:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      },
      "patch": {
        "operationId": "updateJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Update a job",
        "description": "Send only what changes. `state` moves the job like the lifecycle routes, and `botId` assigns the bot (null unassigns it).",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\nThe new `state` is not allowed from the current one. The code is the one of the matching lifecycle route, for example `CANCEL_JOB_ALREADY_FINALIZED`.\n\n`CANNOT_START_JOB_NO_BOT`: `state` is `in_progress` and the job has no bot.\n\n`ASSIGN_BOT_JOB_DOES_NOT_REQUIRE_BOT`: `botId` is set on a job with `requiresBot` false.\n\n`ASSIGN_BOT_JOB_FINALIZED`: `botId` is set on a finished job.\n\n`UNASSIGN_BOT_JOB_IN_PROGRESS`: `botId` is null on an in-progress job.\n\n`JOB_SCHEDULED_AT_REQUIRED`: `state` is `scheduled`. Use the schedule route instead.\n\n`INVALID_BOT`: The bot does not exist or is at another location.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "when": "The new `state` is not allowed from the current one. The code is the one of the matching lifecycle route, for example `CANCEL_JOB_ALREADY_FINALIZED`."
              },
              {
                "code": "CANNOT_START_JOB_NO_BOT",
                "when": "`state` is `in_progress` and the job has no bot."
              },
              {
                "code": "ASSIGN_BOT_JOB_DOES_NOT_REQUIRE_BOT",
                "when": "`botId` is set on a job with `requiresBot` false."
              },
              {
                "code": "ASSIGN_BOT_JOB_FINALIZED",
                "when": "`botId` is set on a finished job."
              },
              {
                "code": "UNASSIGN_BOT_JOB_IN_PROGRESS",
                "when": "`botId` is null on an in-progress job."
              },
              {
                "code": "JOB_SCHEDULED_AT_REQUIRED",
                "when": "`state` is `scheduled`. Use the schedule route instead."
              },
              {
                "code": "INVALID_BOT",
                "when": "The bot does not exist or is at another location."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `version` is not the current `version` plus one.\n\n`BOT_UNAVAILABLE`: The bot is retired, off duty, not connected, or belongs to another partner.\n\n`BOT_BUSY`: The job is in progress and the bot is on another job.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`version` is not the current `version` plus one."
              },
              {
                "code": "BOT_UNAVAILABLE",
                "when": "The bot is retired, off duty, not connected, or belongs to another partner."
              },
              {
                "code": "BOT_BUSY",
                "when": "The job is in progress and the bot is on another job."
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deleteJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Delete a draft job",
        "description": "Only drafts can be deleted. Cancel any other job.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteJobResponse"
                },
                "example": {
                  "data": {
                    "deleted": true,
                    "id": "ES-5868"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The job is not a draft.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The job is not a draft."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/start": {
      "post": {
        "operationId": "startJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Start a job",
        "description": "Moves a pending or scheduled job to `in_progress`. It needs a bot unless `requiresBot` is false.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`CANNOT_START_JOB_NO_BOT`: The job has no bot and needs one.\n\n`START_JOB_INVALID_STATE`: The job is not pending or scheduled.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "CANNOT_START_JOB_NO_BOT",
                "when": "The job has no bot and needs one."
              },
              {
                "code": "START_JOB_INVALID_STATE",
                "when": "The job is not pending or scheduled."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/pause": {
      "post": {
        "operationId": "pauseJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Pause a job",
        "description": "Stops the bot and pauses the running actions.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`PAUSE_JOB_INVALID_STATE`: The job is not in progress.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "PAUSE_JOB_INVALID_STATE",
                "when": "The job is not in progress."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/resume": {
      "post": {
        "operationId": "resumeJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Resume a paused job",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`RESUME_JOB_INVALID_STATE`: The job is not paused.\n\n`RESUME_JOB_NO_BOT`: The job has no bot and needs one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "RESUME_JOB_INVALID_STATE",
                "when": "The job is not paused."
              },
              {
                "code": "RESUME_JOB_NO_BOT",
                "when": "The job has no bot and needs one."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/cancel": {
      "post": {
        "operationId": "cancelJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Cancel a job",
        "description": "Stops the bot, cancels the unfinished actions and frees the bot. A canceled job cannot be resumed.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelJobRequest"
              },
              "example": {
                "reason": "Customer canceled the order"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                },
                "example": {
                  "data": {
                    "id": "ES-5867",
                    "namespace": "partner_example",
                    "externalId": "order-4821",
                    "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                    "version": 5,
                    "name": "Order #4821",
                    "description": null,
                    "pictureURL": null,
                    "assignation": "auto",
                    "start": "auto",
                    "state": "canceled",
                    "currentNodeIndex": 0,
                    "priority": 0,
                    "expendable": false,
                    "createdManually": false,
                    "scheduledAt": null,
                    "targetCompletionAt": null,
                    "startedAt": "2026-06-17T15:43:10.000Z",
                    "finalizedAt": "2026-06-17T15:45:00.000Z",
                    "botId": "4T001",
                    "requiresBot": true,
                    "requiredBotTags": null,
                    "createdAt": "2026-06-17T15:42:00.000Z",
                    "updatedAt": "2026-06-17T15:45:00.000Z",
                    "tags": null,
                    "metadata": {
                      "finalizationReason": "Customer canceled the order"
                    },
                    "nodes": [
                      {
                        "jobId": "ES-5867",
                        "name": "pickup",
                        "description": null,
                        "pictureURL": null,
                        "index": 0,
                        "pointId": "V1StGXR8Z5jdHi6BmyT2q",
                        "lat": 4.6512,
                        "lng": -74.0689,
                        "azimuth": null,
                        "positionIndex": 0,
                        "hasPositionDefined": true,
                        "distance": 1240,
                        "travelDuration": 480000,
                        "actionsDuration": 120000,
                        "totalDuration": 600000,
                        "estimatedArrivalAt": "2026-06-17T15:51:00.000Z",
                        "startedAt": "2026-06-17T15:43:10.000Z",
                        "departedAt": "2026-06-17T15:43:10.000Z",
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "in_progress",
                        "transitState": "interrupted",
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "pickup",
                            "name": "load",
                            "index": 0,
                            "type": "load",
                            "blockingType": "hard",
                            "state": "canceled",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": "2026-06-17T15:45:00.000Z",
                            "duration": 120000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      },
                      {
                        "jobId": "ES-5867",
                        "name": "dropoff",
                        "description": null,
                        "pictureURL": null,
                        "index": 1,
                        "pointId": null,
                        "lat": 4.6602,
                        "lng": -74.0521,
                        "azimuth": null,
                        "positionIndex": 1,
                        "hasPositionDefined": true,
                        "distance": 0,
                        "travelDuration": 1500000,
                        "actionsDuration": 60000,
                        "totalDuration": 1560000,
                        "estimatedArrivalAt": "2026-06-17T16:12:00.000Z",
                        "startedAt": null,
                        "departedAt": null,
                        "arrivedAt": null,
                        "finalizedAt": null,
                        "state": "pending",
                        "transitState": null,
                        "allowFailure": false,
                        "expendable": false,
                        "tags": null,
                        "released": true,
                        "metadata": null,
                        "actions": [
                          {
                            "jobId": "ES-5867",
                            "nodeName": "dropoff",
                            "name": "unload",
                            "index": 0,
                            "type": "unload",
                            "blockingType": "hard",
                            "state": "canceled",
                            "allowFailure": false,
                            "packageName": "pkg-1",
                            "bundleName": null,
                            "metadata": null,
                            "startedAt": null,
                            "finalizedAt": "2026-06-17T15:45:00.000Z",
                            "duration": 60000,
                            "createdAt": "2026-06-17T15:42:00.000Z",
                            "updatedAt": null
                          }
                        ]
                      }
                    ],
                    "packages": [
                      {
                        "jobId": "ES-5867",
                        "name": "pkg-1",
                        "bundleName": null,
                        "description": null,
                        "pictureURL": null,
                        "items": [
                          {
                            "name": "Cheeseburger",
                            "quantity": 1
                          }
                        ],
                        "metadata": null,
                        "station": "Burger Shop",
                        "createdAt": "2026-06-17T15:42:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`CANCEL_JOB_ALREADY_FINALIZED`: The job is already completed, failed or canceled.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "CANCEL_JOB_ALREADY_FINALIZED",
                "when": "The job is already completed, failed or canceled."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/complete": {
      "post": {
        "operationId": "completeJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Complete a job early",
        "description": "Only for an in-progress job that is expendable, or whose current node is. Cancels the unfinished actions and frees the bot.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`COMPLETE_JOB_INVALID_STATE`: The job is not in progress.\n\n`COMPLETE_JOB_NOT_EXPENDABLE`: Neither the job nor its current node is expendable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "COMPLETE_JOB_INVALID_STATE",
                "when": "The job is not in progress."
              },
              {
                "code": "COMPLETE_JOB_NOT_EXPENDABLE",
                "when": "Neither the job nor its current node is expendable."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/fail": {
      "post": {
        "operationId": "failJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Fail a job",
        "description": "Stops the bot, cancels the unfinished actions and frees the bot.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`FAIL_JOB_ALREADY_FINALIZED`: The job is already completed, failed or canceled.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "FAIL_JOB_ALREADY_FINALIZED",
                "when": "The job is already completed, failed or canceled."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/activate": {
      "post": {
        "operationId": "activateJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Activate a draft job",
        "description": "Moves a draft to `pending`. The job needs at least one node, and unique node, action and package names.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`ACTIVATE_JOB_INVALID_STATE`: The job is not a draft.\n\n`VALIDATE_JOB_NO_NODES`: The job has no nodes.\n\n`VALIDATE_JOB_DUPLICATE_NODE`: Two nodes share a name.\n\n`VALIDATE_JOB_DUPLICATE_ACTION`: Two actions of a node share a name.\n\n`VALIDATE_JOB_DUPLICATE_PACKAGE`: Two packages share a name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "ACTIVATE_JOB_INVALID_STATE",
                "when": "The job is not a draft."
              },
              {
                "code": "VALIDATE_JOB_NO_NODES",
                "when": "The job has no nodes."
              },
              {
                "code": "VALIDATE_JOB_DUPLICATE_NODE",
                "when": "Two nodes share a name."
              },
              {
                "code": "VALIDATE_JOB_DUPLICATE_ACTION",
                "when": "Two actions of a node share a name."
              },
              {
                "code": "VALIDATE_JOB_DUPLICATE_PACKAGE",
                "when": "Two packages share a name."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/schedule": {
      "post": {
        "operationId": "scheduleJob",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Schedule a job",
        "description": "Moves a draft, or an already scheduled job, to `scheduled` for the given time.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleJobRequest"
              },
              "example": {
                "scheduledAt": "2026-06-17T18:00:00.000Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`SCHEDULE_JOB_INVALID_STATE`: The job is not a draft or scheduled.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "SCHEDULE_JOB_INVALID_STATE",
                "when": "The job is not a draft or scheduled."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/assign-bot": {
      "post": {
        "operationId": "assignBot",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Assign a bot",
        "description": "Replaces the current bot, if any. On a pending job with `start` set to `auto`, the job starts when the bot is free. On an in-progress job the bot takes over where the job is.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignBotRequest"
              },
              "example": {
                "botId": "4T001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`ASSIGN_BOT_JOB_DOES_NOT_REQUIRE_BOT`: The job has `requiresBot` false.\n\n`ASSIGN_BOT_JOB_FINALIZED`: The job is completed, failed or canceled.\n\n`INVALID_BOT`: The bot does not exist or is at another location.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "ASSIGN_BOT_JOB_DOES_NOT_REQUIRE_BOT",
                "when": "The job has `requiresBot` false."
              },
              {
                "code": "ASSIGN_BOT_JOB_FINALIZED",
                "when": "The job is completed, failed or canceled."
              },
              {
                "code": "INVALID_BOT",
                "when": "The bot does not exist or is at another location."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.\n\n`BOT_UNAVAILABLE`: The bot is retired, off duty, not connected, or belongs to another partner.\n\n`BOT_BUSY`: The job is in progress and the bot is on another job.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              },
              {
                "code": "BOT_UNAVAILABLE",
                "when": "The bot is retired, off duty, not connected, or belongs to another partner."
              },
              {
                "code": "BOT_BUSY",
                "when": "The job is in progress and the bot is on another job."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/unassign-bot": {
      "post": {
        "operationId": "unassignBot",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Unassign the bot",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`UNASSIGN_BOT_JOB_IN_PROGRESS`: The job is in progress. Pause it or assign another bot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "UNASSIGN_BOT_JOB_IN_PROGRESS",
                "when": "The job is in progress. Pause it or assign another bot."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/swap-bots": {
      "post": {
        "operationId": "swapJobBots",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Swap the bots of two jobs",
        "description": "Both jobs need a bot, must be at the same location, and must not be finished. The swap is atomic.",
        "x-scope": "engine",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwapJobBotsRequest"
              },
              "example": {
                "jobId1": "ES-5867",
                "jobId2": "ES-5870"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Both jobs after the swap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwapJobBotsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`CANNOT_SWAP_SAME_JOB`: `jobId1` and `jobId2` are the same.\n\n`NO_BOTS_TO_SWAP`: A job has no bot.\n\n`UPDATE_JOB_LOCATION_NOT_DRAFT`: The jobs are at different locations.\n\n`INVALID_BOT`: A bot is not valid for the other job.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "CANNOT_SWAP_SAME_JOB",
                "when": "`jobId1` and `jobId2` are the same."
              },
              {
                "code": "NO_BOTS_TO_SWAP",
                "when": "A job has no bot."
              },
              {
                "code": "UPDATE_JOB_LOCATION_NOT_DRAFT",
                "when": "The jobs are at different locations."
              },
              {
                "code": "INVALID_BOT",
                "when": "A bot is not valid for the other job."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.\n\n`CANNOT_SWAP_FINALIZED_JOB`: A job is completed, failed or canceled.\n\n`SAME_BOT_ASSIGNED`: Both jobs already have the same bot.\n\n`BOT_UNAVAILABLE`: A bot is busy with a third job and the other job is in progress.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              },
              {
                "code": "CANNOT_SWAP_FINALIZED_JOB",
                "when": "A job is completed, failed or canceled."
              },
              {
                "code": "SAME_BOT_ASSIGNED",
                "when": "Both jobs already have the same bot."
              },
              {
                "code": "BOT_UNAVAILABLE",
                "when": "A bot is busy with a third job and the other job is in progress."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/transfer-bot": {
      "post": {
        "operationId": "transferJobBot",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Move a bot to another job",
        "description": "The source job loses its bot and the target job gets it. Both jobs must be at the same location and not be finished.",
        "x-scope": "engine",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferJobBotRequest"
              },
              "example": {
                "sourceJobId": "ES-5867",
                "targetJobId": "ES-5870"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Both jobs after the transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferJobBotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`CANNOT_SWAP_SAME_JOB`: `sourceJobId` and `targetJobId` are the same.\n\n`NO_BOT_ASSIGNED`: The source job has no bot.\n\n`UPDATE_JOB_LOCATION_NOT_DRAFT`: The jobs are at different locations.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "CANNOT_SWAP_SAME_JOB",
                "when": "`sourceJobId` and `targetJobId` are the same."
              },
              {
                "code": "NO_BOT_ASSIGNED",
                "when": "The source job has no bot."
              },
              {
                "code": "UPDATE_JOB_LOCATION_NOT_DRAFT",
                "when": "The jobs are at different locations."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.\n\n`CANNOT_SWAP_FINALIZED_JOB`: A job is completed, failed or canceled.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              },
              {
                "code": "CANNOT_SWAP_FINALIZED_JOB",
                "when": "A job is completed, failed or canceled."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{id}/jump-to": {
      "post": {
        "operationId": "jumpToNode",
        "tags": [
          "Job lifecycle"
        ],
        "summary": "Jump to a node",
        "description": "Sends an in-progress job straight to a later node, skipping the ones in between.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JumpToNodeRequest"
              },
              "example": {
                "nodeName": "dropoff"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`JUMP_TO_NODE_INVALID_STATE`: The job is not in progress.\n\n`JUMP_TO_NODE_NOT_FOUND`: The job has no node with this name.\n\n`JUMP_TO_NODE_NOT_AFTER_CURRENT`: The node is not after the current one.\n\n`JUMP_TO_NODE_ALREADY_FINALIZED`: The node is already completed or failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "JUMP_TO_NODE_INVALID_STATE",
                "when": "The job is not in progress."
              },
              {
                "code": "JUMP_TO_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "JUMP_TO_NODE_NOT_AFTER_CURRENT",
                "when": "The node is not after the current one."
              },
              {
                "code": "JUMP_TO_NODE_ALREADY_FINALIZED",
                "when": "The node is already completed or failed."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`JOB_VERSION_MISMATCH`: `nextVersion` is not the current `version` plus one.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "JOB_VERSION_MISMATCH",
                "when": "`nextVersion` is not the current `version` plus one."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes": {
      "post": {
        "operationId": "addNode",
        "tags": [
          "Nodes"
        ],
        "summary": "Add a node",
        "description": "Adds a stop to the job, with its actions. On an active job it cannot go before or at the current node.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddNodeRequest"
              },
              "example": {
                "node": {
                  "name": "return",
                  "lat": 4.6498,
                  "lng": -74.0712
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`ADD_NODE_NAME_DUPLICATE`: The job already has a node with this name.\n\n`ADD_NODE_INDEX_OUT_OF_BOUNDS`: `atIndex` is outside the job nodes.\n\n`ADD_NODE_BEFORE_CURRENT`: The job is active and `atIndex` is at or before the current node.\n\n`POINT_NOT_FOUND`: `pointId` is not a point of the job location.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "ADD_NODE_NAME_DUPLICATE",
                "when": "The job already has a node with this name."
              },
              {
                "code": "ADD_NODE_INDEX_OUT_OF_BOUNDS",
                "when": "`atIndex` is outside the job nodes."
              },
              {
                "code": "ADD_NODE_BEFORE_CURRENT",
                "when": "The job is active and `atIndex` is at or before the current node."
              },
              {
                "code": "POINT_NOT_FOUND",
                "when": "`pointId` is not a point of the job location."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}": {
      "patch": {
        "operationId": "updateNode",
        "tags": [
          "Nodes"
        ],
        "summary": "Update a node",
        "description": "Send `pointId`, or `lat` with `lng`, to move the node. A node can be renamed only while pending, and moved only before the bot arrives.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNodeRequest"
              },
              "example": {
                "lat": 4.6605,
                "lng": -74.0525
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`UPDATE_NODE_NAME_NOT_PENDING`: Renaming a node that is not pending.\n\n`UPDATE_NODE_NAME_DUPLICATE`: The new name is taken by another node.\n\n`UPDATE_NODE_POSITION_NOT_PENDING`: Moving a node that is neither pending nor the current one.\n\n`UPDATE_NODE_POSITION_ARRIVED`: Moving a node the bot already arrived at.\n\n`POINT_NOT_FOUND`: `pointId` is not a point of the job location.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "UPDATE_NODE_NAME_NOT_PENDING",
                "when": "Renaming a node that is not pending."
              },
              {
                "code": "UPDATE_NODE_NAME_DUPLICATE",
                "when": "The new name is taken by another node."
              },
              {
                "code": "UPDATE_NODE_POSITION_NOT_PENDING",
                "when": "Moving a node that is neither pending nor the current one."
              },
              {
                "code": "UPDATE_NODE_POSITION_ARRIVED",
                "when": "Moving a node the bot already arrived at."
              },
              {
                "code": "POINT_NOT_FOUND",
                "when": "`pointId` is not a point of the job location."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deleteNode",
        "tags": [
          "Nodes"
        ],
        "summary": "Delete a node",
        "description": "On an active job, only a pending node can be deleted.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`DELETE_NODE_NOT_PENDING`: The job is active and the node is not pending.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "DELETE_NODE_NOT_PENDING",
                "when": "The job is active and the node is not pending."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/release": {
      "post": {
        "operationId": "releaseNode",
        "tags": [
          "Nodes"
        ],
        "summary": "Release a held node",
        "description": "Lets the job move on from a node created with `released` false.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`GET_NODE_NOT_FOUND`: The job has no node with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/arrive": {
      "post": {
        "operationId": "arriveAtNode",
        "tags": [
          "Nodes"
        ],
        "summary": "Mark a node as arrived",
        "description": "Records that the bot reached the node. The node must be in progress and have coordinates.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`ARRIVE_NODE_NOT_IN_PROGRESS`: The node is not in progress.\n\n`ARRIVE_NODE_ALREADY_ARRIVED`: The node already has an arrival.\n\n`ARRIVE_NODE_NO_POSITION`: The node has no coordinates.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "ARRIVE_NODE_NOT_IN_PROGRESS",
                "when": "The node is not in progress."
              },
              {
                "code": "ARRIVE_NODE_ALREADY_ARRIVED",
                "when": "The node already has an arrival."
              },
              {
                "code": "ARRIVE_NODE_NO_POSITION",
                "when": "The node has no coordinates."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/update-estimations": {
      "post": {
        "operationId": "updateNodeEstimations",
        "tags": [
          "Nodes"
        ],
        "summary": "Update travel estimates",
        "description": "Sets the travel time to a node the bot is driving to. The node must be in progress, departed and not yet arrived.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNodeEstimationsRequest"
              },
              "example": {
                "newTravelDuration": 45000,
                "arriving": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the node became `arriving`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateNodeEstimationsResponse"
                },
                "example": {
                  "data": {
                    "arriving": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`UPDATE_NODE_ESTIMATIONS_INVALID_STATE`: The node is not in progress, has not departed, or already arrived.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "UPDATE_NODE_ESTIMATIONS_INVALID_STATE",
                "when": "The node is not in progress, has not departed, or already arrived."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions": {
      "post": {
        "operationId": "addAction",
        "tags": [
          "Actions"
        ],
        "summary": "Add an action",
        "description": "Adds an action to a node, not before the actions that already started.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddActionRequest"
              },
              "example": {
                "action": {
                  "name": "unload-2",
                  "type": "unload",
                  "packageName": "pkg-2"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`ADD_ACTION_NAME_DUPLICATE`: The node already has an action with this name.\n\n`ADD_ACTION_INDEX_OUT_OF_BOUNDS`: `atIndex` is outside the node actions.\n\n`ADD_ACTION_NODE_IN_PAST`: The node is before the current one.\n\n`ADD_ACTION_BEFORE_CURRENT`: `atIndex` is before an action that already started.\n\n`ADD_ACTION_PACKAGE_NOT_FOUND`: `packageName` is not a package of the job.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "ADD_ACTION_NAME_DUPLICATE",
                "when": "The node already has an action with this name."
              },
              {
                "code": "ADD_ACTION_INDEX_OUT_OF_BOUNDS",
                "when": "`atIndex` is outside the node actions."
              },
              {
                "code": "ADD_ACTION_NODE_IN_PAST",
                "when": "The node is before the current one."
              },
              {
                "code": "ADD_ACTION_BEFORE_CURRENT",
                "when": "`atIndex` is before an action that already started."
              },
              {
                "code": "ADD_ACTION_PACKAGE_NOT_FOUND",
                "when": "`packageName` is not a package of the job."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}": {
      "patch": {
        "operationId": "updateAction",
        "tags": [
          "Actions"
        ],
        "summary": "Update an action",
        "description": "An action can be renamed only while pending.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`GET_ACTION_NOT_FOUND`: The node has no action with this name.\n\n`UPDATE_ACTION_NAME_NOT_PENDING`: Renaming an action that is not pending.\n\n`UPDATE_ACTION_NAME_DUPLICATE`: The new name is taken by another action of the node.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "GET_ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              },
              {
                "code": "UPDATE_ACTION_NAME_NOT_PENDING",
                "when": "Renaming an action that is not pending."
              },
              {
                "code": "UPDATE_ACTION_NAME_DUPLICATE",
                "when": "The new name is taken by another action of the node."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deleteAction",
        "tags": [
          "Actions"
        ],
        "summary": "Delete an action",
        "description": "On an active job, only a pending action can be deleted.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`GET_ACTION_NOT_FOUND`: The node has no action with this name.\n\n`DELETE_ACTION_NOT_PENDING`: The job is active and the action is not pending.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "GET_ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              },
              {
                "code": "DELETE_ACTION_NOT_PENDING",
                "when": "The job is active and the action is not pending."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/complete": {
      "post": {
        "operationId": "completeAction",
        "tags": [
          "Actions"
        ],
        "summary": "Complete an action",
        "description": "The action must be in progress. When it was the last one of the node, the job moves on.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`GET_ACTION_NOT_FOUND`: The node has no action with this name.\n\n`COMPLETE_ACTION_NOT_IN_PROGRESS`: The action is not in progress.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "GET_ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              },
              {
                "code": "COMPLETE_ACTION_NOT_IN_PROGRESS",
                "when": "The action is not in progress."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/fail": {
      "post": {
        "operationId": "failAction",
        "tags": [
          "Actions"
        ],
        "summary": "Fail an action",
        "description": "The action must be in progress.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FailActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`GET_ACTION_NOT_FOUND`: The node has no action with this name.\n\n`FAIL_ACTION_NOT_IN_PROGRESS`: The action is not in progress.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "GET_ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              },
              {
                "code": "FAIL_ACTION_NOT_IN_PROGRESS",
                "when": "The action is not in progress."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/skip": {
      "post": {
        "operationId": "skipAction",
        "tags": [
          "Actions"
        ],
        "summary": "Skip an action",
        "description": "The action must be pending or in progress.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FailActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`GET_ACTION_NOT_FOUND`: The node has no action with this name.\n\n`SKIP_ACTION_INVALID_STATE`: The action is neither pending nor in progress.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "GET_ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              },
              {
                "code": "SKIP_ACTION_INVALID_STATE",
                "when": "The action is neither pending nor in progress."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/cancel": {
      "post": {
        "operationId": "cancelAction",
        "tags": [
          "Actions"
        ],
        "summary": "Cancel an action",
        "description": "The action must be pending, in progress or paused.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FailActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_NODE_NOT_FOUND`: The job has no node with this name.\n\n`GET_ACTION_NOT_FOUND`: The node has no action with this name.\n\n`CANCEL_ACTION_INVALID_STATE`: The action is already finished.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "GET_ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              },
              {
                "code": "CANCEL_ACTION_INVALID_STATE",
                "when": "The action is already finished."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/load": {
      "post": {
        "operationId": "loadPackage",
        "tags": [
          "Actions"
        ],
        "summary": "Confirm a package is loaded",
        "description": "Closes the bot door, optionally verifies the package is inside, then completes the `load` action. Call it after the package is in the bot. The action must be in progress.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadPackageRequest"
              },
              "example": {
                "verification": "vri"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadPackageResponse"
                },
                "example": {
                  "data": {
                    "success": true,
                    "doorClosedFailed": false,
                    "botId": "4T001",
                    "verificationResult": "success"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.\n\n`NODE_NOT_FOUND`: The job has no node with this name.\n\n`ACTION_NOT_FOUND`: The node has no action with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              },
              {
                "code": "NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              }
            ]
          },
          "409": {
            "description": "`CANNOT_LOAD_ACTION_NOT_IN_PROGRESS`: The action is not in progress.\n\n`CANNOT_LOAD_ACTION_NOT_LOAD_OR_UNLOAD`: The action type is not `load` or `unload`.\n\n`NO_BOT_ASSIGNED`: The job has no bot.\n\n`CANNOT_CLOSE_DOOR`: The door did not close and `allowDoorClosingFailure` is not set.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "CANNOT_LOAD_ACTION_NOT_IN_PROGRESS",
                "when": "The action is not in progress."
              },
              {
                "code": "CANNOT_LOAD_ACTION_NOT_LOAD_OR_UNLOAD",
                "when": "The action type is not `load` or `unload`."
              },
              {
                "code": "NO_BOT_ASSIGNED",
                "when": "The job has no bot."
              },
              {
                "code": "CANNOT_CLOSE_DOOR",
                "when": "The door did not close and `allowDoorClosingFailure` is not set."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/unload": {
      "post": {
        "operationId": "unloadPackage",
        "tags": [
          "Actions"
        ],
        "summary": "Confirm a package is unloaded",
        "description": "Closes the bot door, optionally verifies the package is gone, then completes the `unload` action. Call it after the package is out of the bot. The action must be in progress.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadPackageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnloadPackageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.\n\n`NODE_NOT_FOUND`: The job has no node with this name.\n\n`ACTION_NOT_FOUND`: The node has no action with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              },
              {
                "code": "NODE_NOT_FOUND",
                "when": "The job has no node with this name."
              },
              {
                "code": "ACTION_NOT_FOUND",
                "when": "The node has no action with this name."
              }
            ]
          },
          "409": {
            "description": "`CANNOT_LOAD_ACTION_NOT_IN_PROGRESS`: The action is not in progress.\n\n`CANNOT_LOAD_ACTION_NOT_LOAD_OR_UNLOAD`: The action type is not `load` or `unload`.\n\n`NO_BOT_ASSIGNED`: The job has no bot.\n\n`CANNOT_CLOSE_DOOR`: The door did not close and `allowDoorClosingFailure` is not set.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "CANNOT_LOAD_ACTION_NOT_IN_PROGRESS",
                "when": "The action is not in progress."
              },
              {
                "code": "CANNOT_LOAD_ACTION_NOT_LOAD_OR_UNLOAD",
                "when": "The action type is not `load` or `unload`."
              },
              {
                "code": "NO_BOT_ASSIGNED",
                "when": "The job has no bot."
              },
              {
                "code": "CANNOT_CLOSE_DOOR",
                "when": "The door did not close and `allowDoorClosingFailure` is not set."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/door": {
      "post": {
        "operationId": "setDoorByAction",
        "tags": [
          "Bots"
        ],
        "summary": "Open or close the door during an action",
        "description": "Moves the door of the job bot. The job must be active with a bot, and the action in progress.\n\nWaits for the door to reach the requested state, up to 25 seconds per attempt, with two attempts. A door that does not move is still a 200: read `success` and `failureReason`.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeName",
            "in": "path",
            "required": true,
            "description": "Node name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionName",
            "in": "path",
            "required": true,
            "description": "Action name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDoorByActionRequest"
              },
              "example": {
                "state": "open"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The door result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetDoorByActionResponse"
                },
                "example": {
                  "data": {
                    "success": true,
                    "missionCreated": false,
                    "failureReason": null,
                    "lastDoorState": "opened"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\nThe job is not in progress or paused, has no bot, or the action is not in progress.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "when": "The job is not in progress or paused, has no bot, or the action is not in progress."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.\n\nThe node has no action with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              },
              {
                "when": "The node has no action with this name."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/packages": {
      "post": {
        "operationId": "addPackage",
        "tags": [
          "Packages"
        ],
        "summary": "Add a package",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPackage"
              },
              "example": {
                "name": "pkg-2",
                "station": "Drinks",
                "items": [
                  {
                    "name": "Lemonade",
                    "quantity": 2
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`ADD_PACKAGE_NAME_DUPLICATE`: The job already has a package with this name.\n\n`STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD`: A load action without `packageName` would cover packages of more than one station.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "ADD_PACKAGE_NAME_DUPLICATE",
                "when": "The job already has a package with this name."
              },
              {
                "code": "STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD",
                "when": "A load action without `packageName` would cover packages of more than one station."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/packages/{packageName}": {
      "patch": {
        "operationId": "updatePackage",
        "tags": [
          "Packages"
        ],
        "summary": "Update a package",
        "description": "A package can be renamed only while none of its actions started.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "packageName",
            "in": "path",
            "required": true,
            "description": "Package name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePackageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`GET_PACKAGE_NOT_FOUND`: The job has no package with this name.\n\n`UPDATE_PACKAGE_NAME_DUPLICATE`: The new name is taken by another package.\n\n`UPDATE_PACKAGE_NAME_IN_USE`: Renaming a package whose actions already started.\n\n`STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD`: A load action without `packageName` would cover packages of more than one station.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "GET_PACKAGE_NOT_FOUND",
                "when": "The job has no package with this name."
              },
              {
                "code": "UPDATE_PACKAGE_NAME_DUPLICATE",
                "when": "The new name is taken by another package."
              },
              {
                "code": "UPDATE_PACKAGE_NAME_IN_USE",
                "when": "Renaming a package whose actions already started."
              },
              {
                "code": "STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD",
                "when": "A load action without `packageName` would cover packages of more than one station."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deletePackage",
        "tags": [
          "Packages"
        ],
        "summary": "Delete a package",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "packageName",
            "in": "path",
            "required": true,
            "description": "Package name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "`GET_PACKAGE_NOT_FOUND`: The job has no package with this name.\n\n`DELETE_PACKAGE_IN_USE`: An action that uses the package already started.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "GET_PACKAGE_NOT_FOUND",
                "when": "The job has no package with this name."
              },
              {
                "code": "DELETE_PACKAGE_IN_USE",
                "when": "An action that uses the package already started."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/hooks": {
      "post": {
        "operationId": "addHook",
        "tags": [
          "Hooks"
        ],
        "summary": "Add a hook",
        "description": "The hook fires on every event that matches its filters. A filter you leave out matches everything.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewHook"
              },
              "example": {
                "name": "notify-partner",
                "target": "https://example.com/hooks/engine",
                "eventType": [
                  "job_started",
                  "job_finalized"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created hook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddHookResponse"
                },
                "example": {
                  "data": {
                    "jobId": "ES-5867",
                    "name": "notify-partner",
                    "eventType": [
                      "job_started",
                      "job_finalized"
                    ],
                    "nodeName": null,
                    "actionName": null,
                    "actionType": null,
                    "packageName": null,
                    "jobState": null,
                    "action": "call_webhook",
                    "target": "https://example.com/hooks/engine",
                    "queueName": null,
                    "metadata": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`HOOK_ACTION_AND_TARGET_UNDEFINED`: No `action`, and `target` has no recognizable scheme.\n\n`HOOK_ACTION_NOT_ALLOWED`: `action` is not `call_webhook`, or `target` is not an `http(s)` URL.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "HOOK_ACTION_AND_TARGET_UNDEFINED",
                "when": "No `action`, and `target` has no recognizable scheme."
              },
              {
                "code": "HOOK_ACTION_NOT_ALLOWED",
                "when": "`action` is not `call_webhook`, or `target` is not an `http(s)` URL."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          },
          "409": {
            "description": "`DUPLICATE_HOOK_NAME`: The job already has a hook with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "code": "DUPLICATE_HOOK_NAME",
                "when": "The job already has a hook with this name."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/hooks/{hookName}": {
      "patch": {
        "operationId": "updateHook",
        "tags": [
          "Hooks"
        ],
        "summary": "Update a hook",
        "description": "Send only what changes. The name cannot change.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hookName",
            "in": "path",
            "required": true,
            "description": "Hook name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateHookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated hook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateHookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\n`HOOK_ACTION_NOT_ALLOWED`: `action` is not `call_webhook`, or `target` is not an `http(s)` URL.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "code": "HOOK_ACTION_NOT_ALLOWED",
                "when": "`action` is not `call_webhook`, or `target` is not an `http(s)` URL."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.\n\n`HOOK_NOT_FOUND`: The job has no hook with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              },
              {
                "code": "HOOK_NOT_FOUND",
                "when": "The job has no hook with this name."
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deleteHook",
        "tags": [
          "Hooks"
        ],
        "summary": "Delete a hook",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hookName",
            "in": "path",
            "required": true,
            "description": "Hook name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The hook was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteHookResponse"
                },
                "example": {
                  "data": {
                    "deleted": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.\n\n`HOOK_NOT_FOUND`: The job has no hook with this name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              },
              {
                "code": "HOOK_NOT_FOUND",
                "when": "The job has no hook with this name."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/events": {
      "get": {
        "operationId": "listJobEvents",
        "tags": [
          "Events"
        ],
        "summary": "List the events of a job",
        "description": "Oldest first. Pass `pagination.next_cursor` as `cursor` to get the next page; it is null on the last page.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 50. Default 50.",
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` of the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListJobEventsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "019ed63f-1940-7c1a-9d3e-5b8f2a6e4c10",
                      "jobId": "ES-5867",
                      "namespace": "partner_example",
                      "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                      "jobVersion": 1,
                      "sequence": 0,
                      "jobState": "pending",
                      "botId": null,
                      "nodeName": null,
                      "actionName": null,
                      "packageName": null,
                      "eventType": "job_created",
                      "path": "jobs.partner_example.ES-5867.created",
                      "operation": "create_job",
                      "user": null,
                      "metadata": {
                        "job": {
                          "id": "ES-5867",
                          "namespace": "partner_example",
                          "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                          "state": "pending",
                          "botId": null,
                          "requiresBot": true,
                          "version": 1
                        }
                      },
                      "exportedAt": null,
                      "createdAt": "2026-06-17T15:42:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "limit": 50
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, for example `limit` above 50.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid query, for example `limit` above 50."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/alerts": {
      "post": {
        "operationId": "createJobAlert",
        "tags": [
          "Alerts"
        ],
        "summary": "Raise an alert on a job",
        "description": "The location, bot and job version are filled in from the job.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJobAlertRequest"
              },
              "example": {
                "name": "pickup-delay",
                "description": "The kitchen is 10 minutes late.",
                "priority": 50
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created alert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateJobAlertResponse"
                },
                "example": {
                  "data": {
                    "id": "019ed641-6330-7e2f-b5a1-3c7d9e0f4a68",
                    "jobId": "ES-5867",
                    "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                    "namespace": "partner_example",
                    "botId": "4T001",
                    "jobVersion": 4,
                    "name": "pickup-delay",
                    "description": "The kitchen is 10 minutes late.",
                    "priority": 50,
                    "eventType": null,
                    "eventPath": null,
                    "eventId": null,
                    "eventData": null,
                    "createdAt": "2026-06-17T15:44:30.000Z",
                    "metadata": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      },
      "get": {
        "operationId": "listJobAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "List the alerts of a job",
        "description": "Oldest first. Pass `pagination.next_cursor` as `cursor` to get the next page; it is null on the last page.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100. Default 50.",
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only alerts with this name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListJobAlertsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, for example `limit` above 100.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid query, for example `limit` above 100."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    },
    "/engine/alerts": {
      "get": {
        "operationId": "listAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "List alerts across jobs",
        "description": "Newest first by default. Send `next_cursor.id` as `cursor_id` and `next_cursor.created_at` as `cursor_created_at` to get the next page. `next_cursor` is null on the last page.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100. Default 50.",
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor_id",
            "in": "query",
            "required": false,
            "description": "`next_cursor.id` of the previous page. Send it with `cursor_created_at`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor_created_at",
            "in": "query",
            "required": false,
            "description": "`next_cursor.created_at` of the previous page. Send it with `cursor_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "By creation time. Default `desc`.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "locations",
            "in": "query",
            "required": false,
            "description": "Comma-separated location ids. Only jobs at these locations.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only alerts with this name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAlertsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "019ed641-6330-7e2f-b5a1-3c7d9e0f4a68",
                      "jobId": "ES-5867",
                      "locationId": "7Nk2QhVpXrLmT4wZaBcDe",
                      "namespace": "partner_example",
                      "botId": "4T001",
                      "jobVersion": 4,
                      "name": "pickup-delay",
                      "description": "The kitchen is 10 minutes late.",
                      "priority": 50,
                      "eventType": null,
                      "eventPath": null,
                      "eventId": null,
                      "eventData": null,
                      "createdAt": "2026-06-17T15:44:30.000Z",
                      "metadata": null
                    }
                  ],
                  "pagination": {
                    "next_cursor": {
                      "id": "019ed641-6330-7e2f-b5a1-3c7d9e0f4a68",
                      "created_at": "2026-06-17T15:44:30.000Z"
                    },
                    "limit": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, for example `limit` above 100.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid query, for example `limit` above 100."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          }
        }
      }
    },
    "/engine/bots/{botId}/actions/door": {
      "post": {
        "operationId": "setDoorByBot",
        "tags": [
          "Bots"
        ],
        "summary": "Open or close a bot door",
        "description": "Waits for the door to reach the requested state, up to 25 seconds per attempt, with two attempts. A door that does not move is still a 200: read `success` and `failureReason`.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "botId",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDoorByActionRequest"
              },
              "example": {
                "state": "closed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The door result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetDoorByBotResponse"
                },
                "example": {
                  "data": {
                    "success": false,
                    "missionCreated": false,
                    "failureReason": "timeout",
                    "lastDoorState": "closing"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.\n\nThe bot is not one of yours and has no active job of yours.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              },
              {
                "when": "The bot is not one of yours and has no active job of yours."
              }
            ]
          },
          "404": {
            "description": "No bot with this id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No bot with this id."
              }
            ]
          }
        }
      }
    },
    "/engine/bots/{botId}/actions/animation": {
      "post": {
        "operationId": "playBotAnimation",
        "tags": [
          "Bots"
        ],
        "summary": "Play a screen animation",
        "description": "Sent to the bot without waiting for it to play.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "botId",
            "in": "path",
            "required": true,
            "description": "Bot id, for example `4T001`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlayBotAnimationRequest"
              },
              "example": {
                "animationId": 5,
                "keepFixed": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The animation was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayBotAnimationResponse"
                },
                "example": {
                  "data": {
                    "success": true,
                    "botId": "4T001",
                    "action": "animation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.\n\nThe bot is not one of yours and has no active job of yours.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              },
              {
                "when": "The bot is not one of yours and has no active job of yours."
              }
            ]
          },
          "404": {
            "description": "No bot with this id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No bot with this id."
              }
            ]
          }
        }
      }
    },
    "/engine/jobs/{jobId}/bot/actions/door": {
      "post": {
        "operationId": "setDoorByJob",
        "tags": [
          "Bots"
        ],
        "summary": "Open or close the door of a job bot",
        "description": "The job must be in progress or paused, with a bot.\n\nWaits for the door to reach the requested state, up to 25 seconds per attempt, with two attempts. A door that does not move is still a 200: read `success` and `failureReason`.",
        "x-scope": "engine",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDoorByActionRequest"
              },
              "example": {
                "state": "open"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The door result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetDoorByJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body.\n\nThe job is not in progress or paused, or has no bot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Invalid body."
              },
              {
                "when": "The job is not in progress or paused, or has no bot."
              }
            ]
          },
          "401": {
            "description": "Missing or invalid API key. The body is `{ \"message\": \"Unauthorized\" }`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "x-error-codes": [
              {
                "when": "Missing or invalid API key."
              }
            ]
          },
          "403": {
            "description": "The API key does not have the `engine` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "The API key does not have the `engine` scope."
              }
            ]
          },
          "404": {
            "description": "No job with this id in your namespace.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-error-codes": [
              {
                "when": "No job with this id in your namespace."
              }
            ]
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key with the `engine` scope, sent as `Authorization: Bearer <key>`. Ask your Robot.com representative for one."
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Always `about:blank`."
          },
          "title": {
            "type": "string",
            "description": "The HTTP status text."
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "detail": {
            "type": "string",
            "description": "Human-readable. Do not parse it: branch on `code`."
          },
          "instance": {
            "type": "string",
            "description": "The request path."
          },
          "code": {
            "description": "Stable machine-readable error code, when the error has one.",
            "type": "string"
          },
          "params": {
            "description": "Values that explain the error, keyed by name.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance"
        ]
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Job id, usually like `ES-5867`. Treat it as an opaque string."
          },
          "namespace": {
            "type": "string",
            "description": "The namespace that owns the job."
          },
          "externalId": {
            "description": "Your own reference. Unique among your active jobs.",
            "type": [
              "string",
              "null"
            ]
          },
          "locationId": {
            "type": "string"
          },
          "version": {
            "type": "number",
            "description": "Increases by one on every change. Send the current value plus one as `nextVersion` to reject concurrent edits."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "description": "Markdown.",
            "type": [
              "string",
              "null"
            ]
          },
          "pictureURL": {
            "type": [
              "string",
              "null"
            ]
          },
          "assignation": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ],
            "description": "`auto`: a bot is assigned for you. `manual`: you assign it."
          },
          "start": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ],
            "description": "`auto`: starts once a bot is assigned and free. `manual`: waits for the start route."
          },
          "state": {
            "$ref": "#/components/schemas/JobState"
          },
          "currentNodeIndex": {
            "description": "`index` of the node in progress. Null until the job starts.",
            "type": [
              "number",
              "null"
            ]
          },
          "priority": {
            "type": "number",
            "description": "From 0 (lowest) to 100 (highest)."
          },
          "expendable": {
            "type": "boolean",
            "description": "True if the job can be ended early to free its bot without counting as failed."
          },
          "createdManually": {
            "type": "boolean",
            "description": "True when a person created the job in the REMI app, false when it came from the API."
          },
          "scheduledAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the job should reach its first node."
          },
          "targetCompletionAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the job is expected to finish."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finalizedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the job reached a final state."
          },
          "botId": {
            "description": "The assigned bot, for example `4T001`.",
            "type": [
              "string",
              "null"
            ]
          },
          "requiresBot": {
            "type": "boolean",
            "description": "False for a job that runs without a bot."
          },
          "requiredBotTags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Only bots with every one of these tags can take the job. Null or empty: any bot."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "description": "Free-form JSON object, or null."
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "description": "In visiting order."
          },
          "hooks": {
            "description": "Only with `include_hooks=true`.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Hook"
            }
          },
          "alerts": {
            "description": "Only with `include_alerts=true`.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Package"
            }
          },
          "events": {
            "description": "Only with `include_events=true`.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          }
        },
        "required": [
          "id",
          "namespace",
          "externalId",
          "locationId",
          "version",
          "name",
          "description",
          "pictureURL",
          "assignation",
          "start",
          "state",
          "currentNodeIndex",
          "priority",
          "expendable",
          "createdManually",
          "scheduledAt",
          "targetCompletionAt",
          "startedAt",
          "finalizedAt",
          "botId",
          "requiresBot",
          "requiredBotTags",
          "createdAt",
          "updatedAt",
          "tags",
          "metadata",
          "nodes",
          "packages"
        ]
      },
      "JobState": {
        "type": "string",
        "enum": [
          "draft",
          "scheduled",
          "pending",
          "in_progress",
          "paused",
          "completed",
          "failed",
          "canceled"
        ],
        "description": "`draft`: being prepared, never auto-assigned or started. `scheduled`: waits for its time. `pending`: ready to be assigned and started. `in_progress`: a bot is working on it. `paused`: on hold. `completed`, `failed` and `canceled` are final."
      },
      "Node": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Unique within the job."
          },
          "description": {
            "description": "Markdown.",
            "type": [
              "string",
              "null"
            ]
          },
          "pictureURL": {
            "type": [
              "string",
              "null"
            ]
          },
          "index": {
            "type": "number",
            "description": "Position in the job, from 0."
          },
          "pointId": {
            "description": "The registered point this node was created from, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "lng": {
            "type": [
              "number",
              "null"
            ]
          },
          "azimuth": {
            "type": [
              "number",
              "null"
            ]
          },
          "positionIndex": {
            "description": "Position among the nodes that have coordinates.",
            "type": [
              "number",
              "null"
            ]
          },
          "hasPositionDefined": {
            "type": "boolean",
            "description": "True when `lat` and `lng` are set."
          },
          "distance": {
            "type": "number",
            "description": "Estimated distance to the next node."
          },
          "travelDuration": {
            "type": "number",
            "description": "Estimated travel time to this node, in milliseconds."
          },
          "actionsDuration": {
            "type": "number",
            "description": "Estimated time of the actions at this node, in milliseconds."
          },
          "totalDuration": {
            "type": "number",
            "description": "Estimated time at this node in milliseconds: travel plus the actions that cannot run in parallel."
          },
          "estimatedArrivalAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estimated arrival, or the real one once the bot arrived. It can be stale between updates."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "departedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the bot left for this node."
          },
          "arrivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the bot arrived at this node."
          },
          "finalizedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "$ref": "#/components/schemas/NodeState"
          },
          "transitState": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "in_transit",
                  "arriving",
                  "interrupted"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "`in_transit`: the bot is driving here. `arriving`: it is close. `interrupted`: the leg was abandoned."
          },
          "allowFailure": {
            "type": "boolean",
            "description": "The job continues if this node fails."
          },
          "expendable": {
            "type": "boolean",
            "description": "The job can be ended early at this node without counting as failed."
          },
          "tags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "released": {
            "type": "boolean",
            "description": "If false, the node waits for the release route before the job moves on."
          },
          "metadata": {
            "description": "Free-form JSON object, or null."
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "description": "In execution order."
          }
        },
        "required": [
          "jobId",
          "name",
          "description",
          "pictureURL",
          "index",
          "pointId",
          "lat",
          "lng",
          "azimuth",
          "positionIndex",
          "hasPositionDefined",
          "distance",
          "travelDuration",
          "actionsDuration",
          "totalDuration",
          "estimatedArrivalAt",
          "startedAt",
          "departedAt",
          "arrivedAt",
          "finalizedAt",
          "state",
          "transitState",
          "allowFailure",
          "expendable",
          "tags",
          "released",
          "metadata",
          "actions"
        ]
      },
      "NodeState": {
        "type": "string",
        "enum": [
          "pending",
          "in_progress",
          "completed",
          "failed"
        ]
      },
      "Action": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "nodeName": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Unique within the node."
          },
          "index": {
            "type": "number",
            "description": "Position in the node, from 0."
          },
          "type": {
            "type": "string",
            "description": "What the action does. `load` and `unload` are handled by the engine; other values are free-form."
          },
          "blockingType": {
            "type": "string",
            "enum": [
              "hard",
              "soft"
            ],
            "description": "`hard` blocks the movement and the other actions. `soft` blocks only the movement."
          },
          "state": {
            "$ref": "#/components/schemas/ActionState"
          },
          "allowFailure": {
            "type": "boolean",
            "description": "The job continues if this action fails."
          },
          "packageName": {
            "description": "For `load` and `unload`: the package it handles.",
            "type": [
              "string",
              "null"
            ]
          },
          "bundleName": {
            "description": "For `load` and `unload`: handles every package of this bundle instead of one package.",
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "description": "Free-form JSON object, or null."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finalizedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration": {
            "type": "number",
            "description": "Estimated duration in milliseconds."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "jobId",
          "nodeName",
          "name",
          "index",
          "type",
          "blockingType",
          "state",
          "allowFailure",
          "packageName",
          "bundleName",
          "metadata",
          "startedAt",
          "finalizedAt",
          "duration",
          "createdAt",
          "updatedAt"
        ]
      },
      "ActionState": {
        "type": "string",
        "enum": [
          "pending",
          "in_progress",
          "paused",
          "completed",
          "failed",
          "skipped",
          "canceled"
        ]
      },
      "Package": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Unique within the job."
          },
          "bundleName": {
            "description": "Group identifier.",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "description": "Markdown.",
            "type": [
              "string",
              "null"
            ]
          },
          "pictureURL": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "name",
                    "quantity"
                  ],
                  "additionalProperties": {}
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "station": {
            "description": "Prep station that owns the package.",
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "jobId",
          "name",
          "bundleName",
          "description",
          "pictureURL",
          "items",
          "metadata",
          "station",
          "createdAt"
        ]
      },
      "Hook": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Unique within the job."
          },
          "eventType": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "job_created",
                    "job_updated",
                    "job_deleted",
                    "job_bot_assigned",
                    "job_bot_unassigned",
                    "job_scheduled",
                    "job_pending",
                    "job_started",
                    "job_paused",
                    "job_resumed",
                    "job_finalized",
                    "job_canceled",
                    "job_failed",
                    "job_completed",
                    "job_state_changed",
                    "bot_set_goal_failed",
                    "bot_taken",
                    "bot_released",
                    "bot_stopped",
                    "bot_goal_set",
                    "bot_goal_registered",
                    "bot_teleop_mission_created",
                    "door_opened",
                    "door_closed",
                    "door_state_change_failed",
                    "door_stalled",
                    "door_blocked_charging",
                    "node_added",
                    "node_updated",
                    "node_deleted",
                    "node_state_changed",
                    "node_started",
                    "node_departed",
                    "node_arriving",
                    "node_eta_changed",
                    "node_arrived",
                    "node_arrived_far",
                    "node_released",
                    "node_completed",
                    "node_phase_completed",
                    "node_failed",
                    "action_added",
                    "action_updated",
                    "action_deleted",
                    "action_started",
                    "action_paused",
                    "action_resumed",
                    "action_completed",
                    "action_failed",
                    "action_skipped",
                    "action_canceled",
                    "alert_created",
                    "alert_updated",
                    "alert_deleted",
                    "hook_added",
                    "hook_updated",
                    "hook_deleted",
                    "hook_triggered",
                    "package_added",
                    "package_updated",
                    "package_deleted",
                    "package_loaded",
                    "package_unloaded",
                    "package_loaded_failed",
                    "package_unloaded_failed",
                    "refund_recorded",
                    "custom_event",
                    "assigner_executed"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fires only for these event types. Null: all."
          },
          "nodeName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fires only for these nodes. Null: all."
          },
          "actionName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fires only for these actions. Null: all."
          },
          "actionType": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fires only for these action types. Null: all."
          },
          "packageName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fires only for these packages. Null: all."
          },
          "jobState": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fires only while the job is in one of these states. Null: all."
          },
          "action": {
            "type": "string",
            "description": "What the hook does, for example `call_webhook`."
          },
          "target": {
            "description": "Where the action delivers, for example a URL.",
            "type": [
              "string",
              "null"
            ]
          },
          "queueName": {
            "description": "Hooks of the same job that share a queue name run one at a time, in event order. Null: they run concurrently.",
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "description": "Settings for the action, or null."
          }
        },
        "required": [
          "jobId",
          "name",
          "eventType",
          "nodeName",
          "actionName",
          "actionType",
          "packageName",
          "jobState",
          "action",
          "target",
          "queueName",
          "metadata"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Time-ordered: events sort by `id`."
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "namespace": {
            "type": [
              "string",
              "null"
            ]
          },
          "locationId": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobVersion": {
            "description": "The job `version` when the event happened.",
            "type": [
              "number",
              "null"
            ]
          },
          "sequence": {
            "type": "number",
            "description": "Orders events that share a timestamp and a job version."
          },
          "jobState": {
            "type": [
              "string",
              "null"
            ]
          },
          "botId": {
            "type": [
              "string",
              "null"
            ]
          },
          "nodeName": {
            "type": [
              "string",
              "null"
            ]
          },
          "actionName": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageName": {
            "type": [
              "string",
              "null"
            ]
          },
          "eventType": {
            "type": "string",
            "enum": [
              "job_created",
              "job_updated",
              "job_deleted",
              "job_bot_assigned",
              "job_bot_unassigned",
              "job_scheduled",
              "job_pending",
              "job_started",
              "job_paused",
              "job_resumed",
              "job_finalized",
              "job_canceled",
              "job_failed",
              "job_completed",
              "job_state_changed",
              "bot_set_goal_failed",
              "bot_taken",
              "bot_released",
              "bot_stopped",
              "bot_goal_set",
              "bot_goal_registered",
              "bot_teleop_mission_created",
              "door_opened",
              "door_closed",
              "door_state_change_failed",
              "door_stalled",
              "door_blocked_charging",
              "node_added",
              "node_updated",
              "node_deleted",
              "node_state_changed",
              "node_started",
              "node_departed",
              "node_arriving",
              "node_eta_changed",
              "node_arrived",
              "node_arrived_far",
              "node_released",
              "node_completed",
              "node_phase_completed",
              "node_failed",
              "action_added",
              "action_updated",
              "action_deleted",
              "action_started",
              "action_paused",
              "action_resumed",
              "action_completed",
              "action_failed",
              "action_skipped",
              "action_canceled",
              "alert_created",
              "alert_updated",
              "alert_deleted",
              "hook_added",
              "hook_updated",
              "hook_deleted",
              "hook_triggered",
              "package_added",
              "package_updated",
              "package_deleted",
              "package_loaded",
              "package_unloaded",
              "package_loaded_failed",
              "package_unloaded_failed",
              "refund_recorded",
              "custom_event",
              "assigner_executed"
            ]
          },
          "path": {
            "type": "string",
            "description": "Where the event happened, as a dotted path."
          },
          "operation": {
            "description": "The operation that caused it, for example `create_job`.",
            "type": [
              "string",
              "null"
            ]
          },
          "user": {
            "description": "Who triggered the operation.",
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "description": "Details of the event. Their shape depends on `eventType`."
          },
          "exportedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deprecated. Null on current events."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "jobId",
          "namespace",
          "locationId",
          "jobVersion",
          "sequence",
          "jobState",
          "botId",
          "nodeName",
          "actionName",
          "packageName",
          "eventType",
          "path",
          "operation",
          "user",
          "metadata",
          "exportedAt",
          "createdAt"
        ]
      },
      "Alert": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "jobId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          },
          "botId": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobVersion": {
            "type": "number",
            "description": "The job `version` when the alert was raised."
          },
          "name": {
            "type": "string",
            "description": "Category of the alert."
          },
          "description": {
            "type": "string",
            "description": "Markdown."
          },
          "priority": {
            "type": "number",
            "description": "From 0 (lowest) to 100 (highest)."
          },
          "eventType": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "job_created",
                  "job_updated",
                  "job_deleted",
                  "job_bot_assigned",
                  "job_bot_unassigned",
                  "job_scheduled",
                  "job_pending",
                  "job_started",
                  "job_paused",
                  "job_resumed",
                  "job_finalized",
                  "job_canceled",
                  "job_failed",
                  "job_completed",
                  "job_state_changed",
                  "bot_set_goal_failed",
                  "bot_taken",
                  "bot_released",
                  "bot_stopped",
                  "bot_goal_set",
                  "bot_goal_registered",
                  "bot_teleop_mission_created",
                  "door_opened",
                  "door_closed",
                  "door_state_change_failed",
                  "door_stalled",
                  "door_blocked_charging",
                  "node_added",
                  "node_updated",
                  "node_deleted",
                  "node_state_changed",
                  "node_started",
                  "node_departed",
                  "node_arriving",
                  "node_eta_changed",
                  "node_arrived",
                  "node_arrived_far",
                  "node_released",
                  "node_completed",
                  "node_phase_completed",
                  "node_failed",
                  "action_added",
                  "action_updated",
                  "action_deleted",
                  "action_started",
                  "action_paused",
                  "action_resumed",
                  "action_completed",
                  "action_failed",
                  "action_skipped",
                  "action_canceled",
                  "alert_created",
                  "alert_updated",
                  "alert_deleted",
                  "hook_added",
                  "hook_updated",
                  "hook_deleted",
                  "hook_triggered",
                  "package_added",
                  "package_updated",
                  "package_deleted",
                  "package_loaded",
                  "package_unloaded",
                  "package_loaded_failed",
                  "package_unloaded_failed",
                  "refund_recorded",
                  "custom_event",
                  "assigner_executed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The event that raised the alert, if one did."
          },
          "eventPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "eventId": {
            "type": [
              "string",
              "null"
            ]
          },
          "eventData": {
            "description": "Data of the event that raised the alert, or null."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "description": "Free-form JSON object, or null."
          }
        },
        "required": [
          "id",
          "jobId",
          "locationId",
          "namespace",
          "botId",
          "jobVersion",
          "name",
          "description",
          "priority",
          "eventType",
          "eventPath",
          "eventId",
          "eventData",
          "createdAt",
          "metadata"
        ]
      },
      "JobOverview": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number"
          },
          "active": {
            "type": "number",
            "description": "Draft, scheduled, pending, in progress and paused."
          },
          "draft": {
            "type": "number"
          },
          "scheduled": {
            "type": "number"
          },
          "pending": {
            "type": "number"
          },
          "in_progress": {
            "type": "number"
          },
          "paused": {
            "type": "number"
          },
          "completed": {
            "type": "number"
          },
          "failed": {
            "type": "number"
          },
          "canceled": {
            "type": "number"
          },
          "completedLast24h": {
            "type": "number"
          },
          "failedLast24h": {
            "type": "number"
          }
        },
        "required": [
          "total",
          "active",
          "draft",
          "scheduled",
          "pending",
          "in_progress",
          "paused",
          "completed",
          "failed",
          "canceled",
          "completedLast24h",
          "failedLast24h"
        ]
      },
      "DoorResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "True when the door reached the requested state."
          },
          "missionCreated": {
            "type": "boolean",
            "description": "Always false from this API."
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "stalled",
                  "timeout",
                  "wrong_state",
                  "charging"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Null on success. `stalled`: the door is stuck. `timeout`: no answer in time. `wrong_state`: it ended in the opposite state. `charging`: the bot is on its charger."
          },
          "lastDoorState": {
            "type": "string",
            "description": "The last door state the bot reported."
          }
        },
        "required": [
          "success",
          "missionCreated",
          "failureReason",
          "lastDoorState"
        ]
      },
      "LoadUnloadResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "False when the `vri` check failed. The action stays in progress then."
          },
          "doorClosedFailed": {
            "type": "boolean",
            "description": "True when the door could not be closed and `allowDoorClosingFailure` let the call go on."
          },
          "botId": {
            "type": "string"
          },
          "verificationResult": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "success",
                  "failed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when no `verification` was requested."
          }
        },
        "required": [
          "success",
          "doorClosedFailed",
          "botId",
          "verificationResult"
        ]
      },
      "NewNode": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the node. Must be unique per job."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024,
                "description": "A description in markdown format."
              },
              {
                "type": "null"
              }
            ]
          },
          "pictureURL": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL of a picture of the stop."
          },
          "pointId": {
            "description": "A registered point of the job's location. The node takes its coordinates. An unknown point answers `POINT_NOT_FOUND`.",
            "type": [
              "string",
              "null"
            ]
          },
          "lat": {
            "anyOf": [
              {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              },
              {
                "type": "null"
              }
            ],
            "description": "Latitude of the node."
          },
          "lng": {
            "anyOf": [
              {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              },
              {
                "type": "null"
              }
            ],
            "description": "Longitude of the node."
          },
          "azimuth": {
            "description": "Azimuth of the node.",
            "type": [
              "number",
              "null"
            ]
          },
          "expendable": {
            "description": "Whether the job is expendable in this node.",
            "type": "boolean"
          },
          "allowFailure": {
            "description": "Whether failure of this node is allowed.",
            "type": "boolean"
          },
          "travelDuration": {
            "description": "Estimated travel time to this node, in milliseconds.",
            "type": "number",
            "minimum": 0
          },
          "released": {
            "description": "If false, the node requires manual confirmation to move forward.",
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          },
          "actions": {
            "description": "Actions to run at the node, in order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewAction"
            }
          }
        }
      },
      "NewAction": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the action. Must be unique per node."
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "What the action does. `load` and `unload` are handled by the engine (see the load and unload routes); other values are free-form."
          },
          "duration": {
            "description": "Estimated time to complete the action, in milliseconds.",
            "type": "number",
            "minimum": 0
          },
          "packageName": {
            "description": "The name of the package associated with the action.",
            "type": [
              "string",
              "null"
            ]
          },
          "bundleName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "The bundle name associated with the action."
              },
              {
                "type": "null"
              }
            ]
          },
          "blockingType": {
            "description": "`hard` (default) blocks the movement and the other actions. `soft` blocks only the movement.",
            "type": "string",
            "enum": [
              "soft",
              "hard"
            ]
          },
          "allowFailure": {
            "description": "If true, the job continues when this action fails.",
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata and params for the action."
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "NewPackage": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the package. Must be unique per job."
          },
          "bundleName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "Group identifier for the package."
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024,
                "description": "A description in markdown format."
              },
              {
                "type": "null"
              }
            ]
          },
          "pictureURL": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL of a picture of the package."
          },
          "items": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "name",
                        "quantity"
                      ]
                    },
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "What is inside. Each item needs `name` and `quantity` (at least 1); other fields are kept."
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          },
          "station": {
            "description": "Prep station that owns this package (e.g. \"Burger Shop\"). Trimmed; blank becomes null.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name"
        ]
      },
      "NewHook": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the hook. Must be unique per job."
          },
          "eventType": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "job_created",
                    "job_updated",
                    "job_deleted",
                    "job_bot_assigned",
                    "job_bot_unassigned",
                    "job_scheduled",
                    "job_pending",
                    "job_started",
                    "job_paused",
                    "job_resumed",
                    "job_finalized",
                    "job_canceled",
                    "job_failed",
                    "job_completed",
                    "job_state_changed",
                    "bot_set_goal_failed",
                    "bot_taken",
                    "bot_released",
                    "bot_stopped",
                    "bot_goal_set",
                    "bot_goal_registered",
                    "bot_teleop_mission_created",
                    "door_opened",
                    "door_closed",
                    "door_state_change_failed",
                    "door_stalled",
                    "door_blocked_charging",
                    "node_added",
                    "node_updated",
                    "node_deleted",
                    "node_state_changed",
                    "node_started",
                    "node_departed",
                    "node_arriving",
                    "node_eta_changed",
                    "node_arrived",
                    "node_arrived_far",
                    "node_released",
                    "node_completed",
                    "node_phase_completed",
                    "node_failed",
                    "action_added",
                    "action_updated",
                    "action_deleted",
                    "action_started",
                    "action_paused",
                    "action_resumed",
                    "action_completed",
                    "action_failed",
                    "action_skipped",
                    "action_canceled",
                    "alert_created",
                    "alert_updated",
                    "alert_deleted",
                    "hook_added",
                    "hook_updated",
                    "hook_deleted",
                    "hook_triggered",
                    "package_added",
                    "package_updated",
                    "package_deleted",
                    "package_loaded",
                    "package_unloaded",
                    "package_loaded_failed",
                    "package_unloaded_failed",
                    "refund_recorded",
                    "custom_event",
                    "assigner_executed"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fire only for these event types. Omit for all."
          },
          "nodeName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                },
                "description": "Filter events to specific nodes by their names."
              },
              {
                "type": "null"
              }
            ]
          },
          "actionName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                },
                "description": "Filter events to specific actions by their names."
              },
              {
                "type": "null"
              }
            ]
          },
          "packageName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                },
                "description": "Filter events to specific packages by their names."
              },
              {
                "type": "null"
              }
            ]
          },
          "jobState": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "scheduled",
                    "pending",
                    "in_progress",
                    "paused",
                    "completed",
                    "failed",
                    "canceled"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fire only while the job is in one of these states. Omit for all."
          },
          "action": {
            "description": "Only `call_webhook`. Inferred from an `https://` or `http://` `target` when omitted.",
            "type": "string",
            "const": "call_webhook"
          },
          "target": {
            "description": "The URL to call.",
            "type": "string"
          },
          "queueName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
              },
              {
                "type": "null"
              }
            ],
            "description": "Serialization queue for this hook, scoped to the job. Hooks of the same job sharing a queue name execute one at a time in event order, and a failing hook retries to its limit before the next one runs. Omit for the default concurrent dispatch."
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ],
            "description": "Extra settings for the action. For `call_webhook`: `{ \"webhook\": { \"method\": \"POST\", \"headers\": { \"X-Key\": \"value\" } } }`. `method` is POST, GET, PATCH or PUT; send both `method` and `headers`, or the defaults apply (POST, no extra headers)."
          }
        },
        "required": [
          "name"
        ]
      },
      "GetJobsOverviewResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/JobOverview"
          }
        },
        "required": [
          "data"
        ]
      },
      "ListJobsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Job"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "createdAt"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "limit": {
                "type": "number"
              }
            },
            "required": [
              "next_cursor",
              "limit"
            ]
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "GetJobByBotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Job"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "GetJobResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Job"
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateJobRequest": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The namespace the job belongs to. Must be your API key's namespace."
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "Your own reference for the job. Unique among the active jobs of the namespace."
              },
              {
                "type": "null"
              }
            ]
          },
          "locationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The location the job is associated with."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The name of the job"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024,
                "description": "A description in markdown format."
              },
              {
                "type": "null"
              }
            ]
          },
          "pictureURL": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL of a picture of the job."
          },
          "priority": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "The priority of the job from 0 (lowest) to 100 (highest)."
          },
          "expendable": {
            "description": "If true, the job can be ended early to free its bot without counting as failed.",
            "type": "boolean"
          },
          "botId": {
            "description": "The bot for the job, for example `4T001`. It must be at the job's location and connected.",
            "type": [
              "string",
              "null"
            ]
          },
          "requireAvailableBot": {
            "description": "When true and no specific bot is pinned, reject creation (NO_AVAILABLE_BOT) unless at least one bot is available for the location/namespace. Ignored for draft/scheduled jobs.",
            "type": "boolean"
          },
          "requiresBot": {
            "description": "When false, the job runs without a bot: it can start and progress with no bot assigned, bots cannot be assigned to it, and it must use manual assignation. Defaults to true.",
            "type": "boolean"
          },
          "requiredBotTags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Only bots carrying EVERY one of these bot tags are candidates. Empty or null means any bot."
          },
          "assignation": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ],
            "description": "`auto` (default): a bot is assigned for you. `manual`: you assign it."
          },
          "start": {
            "description": "`auto` (default): the job starts once a bot is assigned and free. `manual`: it waits for the start route.",
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "state": {
            "description": "Initial state. Defaults to `pending`. `scheduled` needs `scheduledAt`.",
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "pending",
              "in_progress"
            ]
          },
          "tags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Labels for searching and filtering."
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          },
          "nodes": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NewNode"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The stops of the job, in visiting order."
          },
          "hooks": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NewHook"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "packages": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NewPackage"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduledAt": {
            "description": "When the job should reach its first node. Required with `state: scheduled`.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "targetCompletionAt": {
            "description": "When the job is expected to finish.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "namespace",
          "locationId",
          "name"
        ]
      },
      "UpdateJobRequest": {
        "type": "object",
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "Your own reference for the job. Unique among the active jobs of the namespace."
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The name of the job"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024,
                "description": "A description in markdown format."
              },
              {
                "type": "null"
              }
            ]
          },
          "pictureURL": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL of a picture of the job."
          },
          "priority": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "The priority of the job from 0 (lowest) to 100 (highest)."
          },
          "expendable": {
            "description": "If true, the job can be ended early to free its bot without counting as failed.",
            "type": "boolean"
          },
          "botId": {
            "description": "The bot for the job, for example `4T001`. It must be at the job's location and connected.",
            "type": [
              "string",
              "null"
            ]
          },
          "requiredBotTags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Only bots carrying EVERY one of these bot tags are candidates. Empty or null means any bot."
          },
          "state": {
            "description": "Move the job to this state.",
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "pending",
              "in_progress",
              "paused",
              "canceled",
              "completed",
              "failed"
            ]
          },
          "tags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Labels for searching and filtering."
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "number",
            "minimum": 0,
            "description": "The version of the job. Must match the next version of the job to update it."
          },
          "scheduledAt": {
            "description": "When the job should reach its first node. Required with `state: scheduled`.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "targetCompletionAt": {
            "description": "When the job is expected to finish.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeleteJobResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "deleted": {
                "type": "boolean",
                "const": true
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "deleted",
              "id"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "StartJobRequest": {
        "type": "object",
        "properties": {
          "nextVersion": {
            "description": "Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`.",
            "type": "number"
          }
        }
      },
      "CancelJobRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "description": "Why. Stored in the job `metadata.finalizationReason` unless one is already set.",
            "type": "string"
          },
          "nextVersion": {
            "description": "Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`.",
            "type": "number"
          }
        }
      },
      "ScheduleJobRequest": {
        "type": "object",
        "properties": {
          "scheduledAt": {
            "description": "When the job should reach its first node, as an ISO 8601 timestamp.",
            "type": "string",
            "format": "date-time"
          },
          "nextVersion": {
            "description": "Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`.",
            "type": "number"
          }
        },
        "required": [
          "scheduledAt"
        ]
      },
      "AssignBotRequest": {
        "type": "object",
        "properties": {
          "botId": {
            "type": "string",
            "description": "The bot to assign, for example `4T001`."
          },
          "nextVersion": {
            "description": "Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`.",
            "type": "number"
          }
        },
        "required": [
          "botId"
        ]
      },
      "SwapJobBotsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "job1": {
                "$ref": "#/components/schemas/Job"
              },
              "job2": {
                "$ref": "#/components/schemas/Job"
              }
            },
            "required": [
              "job1",
              "job2"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "SwapJobBotsRequest": {
        "type": "object",
        "properties": {
          "jobId1": {
            "type": "string"
          },
          "jobId2": {
            "type": "string"
          },
          "nextVersion1": {
            "description": "Expected version of `jobId1` after the swap: its current `version` plus one.",
            "type": "number"
          },
          "nextVersion2": {
            "description": "Expected version of `jobId2` after the swap: its current `version` plus one.",
            "type": "number"
          }
        },
        "required": [
          "jobId1",
          "jobId2"
        ]
      },
      "TransferJobBotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "sourceJob": {
                "$ref": "#/components/schemas/Job"
              },
              "targetJob": {
                "$ref": "#/components/schemas/Job"
              }
            },
            "required": [
              "sourceJob",
              "targetJob"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "TransferJobBotRequest": {
        "type": "object",
        "properties": {
          "sourceJobId": {
            "type": "string",
            "description": "The job that gives up its bot."
          },
          "targetJobId": {
            "type": "string",
            "description": "The job that receives the bot."
          },
          "nextVersionSource": {
            "description": "Expected version of the source job after the transfer: its current `version` plus one.",
            "type": "number"
          },
          "nextVersionTarget": {
            "description": "Expected version of the target job after the transfer: its current `version` plus one.",
            "type": "number"
          }
        },
        "required": [
          "sourceJobId",
          "targetJobId"
        ]
      },
      "JumpToNodeRequest": {
        "type": "object",
        "properties": {
          "nodeName": {
            "type": "string",
            "description": "The node to go to. It must come after the current one and not be finished."
          },
          "nextVersion": {
            "description": "Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`.",
            "type": "number"
          }
        },
        "required": [
          "nodeName"
        ]
      },
      "AddNodeRequest": {
        "type": "object",
        "properties": {
          "node": {
            "$ref": "#/components/schemas/NewNode"
          },
          "atIndex": {
            "description": "Position to insert the node at. Default: the end.",
            "type": "number"
          },
          "jumpToImmediately": {
            "description": "On an in-progress job, send the bot to the new node right away, skipping the nodes in between.",
            "type": "boolean"
          }
        },
        "required": [
          "node"
        ]
      },
      "UpdateNodeRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
          },
          "pointId": {
            "description": "Move the node to this point of the job location.",
            "type": "string",
            "minLength": 1
          },
          "lat": {
            "anyOf": [
              {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              },
              {
                "type": "null"
              }
            ]
          },
          "lng": {
            "anyOf": [
              {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              },
              {
                "type": "null"
              }
            ]
          },
          "azimuth": {
            "type": [
              "number",
              "null"
            ]
          },
          "released": {
            "type": "boolean"
          },
          "expendable": {
            "type": "boolean"
          },
          "allowFailure": {
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "pictureURL": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "UpdateNodeEstimationsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "arriving": {
                "type": "boolean",
                "description": "True when this call moved the node to `arriving`."
              }
            },
            "required": [
              "arriving"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateNodeEstimationsRequest": {
        "type": "object",
        "properties": {
          "newTravelDuration": {
            "type": "number",
            "description": "New estimated travel time to the node, in milliseconds."
          },
          "arriving": {
            "type": "boolean",
            "description": "True when the bot is about to arrive. The node then becomes `arriving`."
          }
        },
        "required": [
          "newTravelDuration",
          "arriving"
        ]
      },
      "AddActionRequest": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/NewAction"
          },
          "atIndex": {
            "description": "Position to insert the action at. Default: the end.",
            "type": "number"
          }
        },
        "required": [
          "action"
        ]
      },
      "UpdateActionRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "packageName": {
            "type": [
              "string",
              "null"
            ]
          },
          "bundleName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
              },
              {
                "type": "null"
              }
            ]
          },
          "blockingType": {
            "type": "string",
            "enum": [
              "soft",
              "hard"
            ]
          },
          "allowFailure": {
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "FailActionRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "description": "Why. Stored in the action `metadata.finalizationReason` unless one is already set.",
            "type": "string"
          }
        }
      },
      "LoadPackageResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/LoadUnloadResult"
          }
        },
        "required": [
          "data"
        ]
      },
      "LoadPackageRequest": {
        "type": "object",
        "properties": {
          "skipCloseDoor": {
            "description": "Do not close the door first.",
            "type": "boolean"
          },
          "allowDoorClosingFailure": {
            "description": "Go on when the door cannot be closed. The result tells whether it failed.",
            "type": "boolean"
          },
          "verification": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "vri"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "`vri`: check with the bot first that the package is inside (load) or gone (unload). If the check fails, the action stays in progress."
          }
        }
      },
      "UnloadPackageResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/LoadUnloadResult"
          }
        },
        "required": [
          "data"
        ]
      },
      "SetDoorByActionResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DoorResult"
          }
        },
        "required": [
          "data"
        ]
      },
      "SetDoorByActionRequest": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "description": "The door state to reach."
          }
        },
        "required": [
          "state"
        ]
      },
      "UpdatePackageRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
          },
          "bundleName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "pictureURL": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "name",
                        "quantity"
                      ]
                    },
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ]
          },
          "station": {
            "description": "Prep station that owns this package. Trimmed; blank becomes null.",
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AddHookResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Hook"
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateHookResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Hook"
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateHookRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "job_created",
                    "job_updated",
                    "job_deleted",
                    "job_bot_assigned",
                    "job_bot_unassigned",
                    "job_scheduled",
                    "job_pending",
                    "job_started",
                    "job_paused",
                    "job_resumed",
                    "job_finalized",
                    "job_canceled",
                    "job_failed",
                    "job_completed",
                    "job_state_changed",
                    "bot_set_goal_failed",
                    "bot_taken",
                    "bot_released",
                    "bot_stopped",
                    "bot_goal_set",
                    "bot_goal_registered",
                    "bot_teleop_mission_created",
                    "door_opened",
                    "door_closed",
                    "door_state_change_failed",
                    "door_stalled",
                    "door_blocked_charging",
                    "node_added",
                    "node_updated",
                    "node_deleted",
                    "node_state_changed",
                    "node_started",
                    "node_departed",
                    "node_arriving",
                    "node_eta_changed",
                    "node_arrived",
                    "node_arrived_far",
                    "node_released",
                    "node_completed",
                    "node_phase_completed",
                    "node_failed",
                    "action_added",
                    "action_updated",
                    "action_deleted",
                    "action_started",
                    "action_paused",
                    "action_resumed",
                    "action_completed",
                    "action_failed",
                    "action_skipped",
                    "action_canceled",
                    "alert_created",
                    "alert_updated",
                    "alert_deleted",
                    "hook_added",
                    "hook_updated",
                    "hook_deleted",
                    "hook_triggered",
                    "package_added",
                    "package_updated",
                    "package_deleted",
                    "package_loaded",
                    "package_unloaded",
                    "package_loaded_failed",
                    "package_unloaded_failed",
                    "refund_recorded",
                    "custom_event",
                    "assigner_executed"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fire only for these event types. Omit for all."
          },
          "nodeName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                },
                "description": "Filter events to specific nodes by their names."
              },
              {
                "type": "null"
              }
            ]
          },
          "actionName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                },
                "description": "Filter events to specific actions by their names."
              },
              {
                "type": "null"
              }
            ]
          },
          "packageName": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[a-zA-Z0-9_-]+$",
                  "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
                },
                "description": "Filter events to specific packages by their names."
              },
              {
                "type": "null"
              }
            ]
          },
          "jobState": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "scheduled",
                    "pending",
                    "in_progress",
                    "paused",
                    "completed",
                    "failed",
                    "canceled"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Fire only while the job is in one of these states. Omit for all."
          },
          "action": {
            "description": "Only `call_webhook`. Inferred from an `https://` or `http://` `target` when omitted.",
            "type": "string",
            "const": "call_webhook"
          },
          "target": {
            "description": "The URL to call.",
            "type": "string"
          },
          "queueName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[a-zA-Z0-9_-]+$",
                "description": "The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens."
              },
              {
                "type": "null"
              }
            ],
            "description": "Serialization queue for this hook, scoped to the job. Hooks of the same job sharing a queue name execute one at a time in event order, and a failing hook retries to its limit before the next one runs. Omit for the default concurrent dispatch."
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "A record of key-value pairs containing additional metadata about the entity."
              },
              {
                "type": "null"
              }
            ],
            "description": "Extra settings for the action. For `call_webhook`: `{ \"webhook\": { \"method\": \"POST\", \"headers\": { \"X-Key\": \"value\" } } }`. `method` is POST, GET, PATCH or PUT; send both `method` and `headers`, or the defaults apply (POST, no extra headers)."
          }
        }
      },
      "DeleteHookResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "deleted": {
                "type": "boolean"
              }
            },
            "required": [
              "deleted"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "ListJobEventsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "limit": {
                "type": "number"
              }
            },
            "required": [
              "next_cursor",
              "limit"
            ]
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "CreateJobAlertResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Alert"
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateJobAlertRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Category of the alert."
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "description": "Markdown."
          },
          "priority": {
            "default": 0,
            "description": "From 0 (lowest) to 100 (highest). Default 0.",
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "description"
        ]
      },
      "ListJobAlertsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "limit": {
                "type": "number"
              }
            },
            "required": [
              "next_cursor",
              "limit"
            ]
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "ListAlertsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "created_at"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "limit": {
                "type": "number"
              }
            },
            "required": [
              "next_cursor",
              "limit"
            ]
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "SetDoorByBotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DoorResult"
          }
        },
        "required": [
          "data"
        ]
      },
      "PlayBotAnimationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "botId": {
                "type": "string"
              },
              "action": {
                "type": "string"
              }
            },
            "required": [
              "success",
              "botId",
              "action"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "PlayBotAnimationRequest": {
        "type": "object",
        "properties": {
          "animationId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Screen animation id. Known: 2 to 14 (dark background) and 15 to 27 (white background)."
          },
          "keepFixed": {
            "default": true,
            "description": "Keep the animation on the screen. Default true.",
            "type": "boolean"
          }
        },
        "required": [
          "animationId"
        ]
      },
      "SetDoorByJobResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DoorResult"
          }
        },
        "required": [
          "data"
        ]
      }
    }
  }
}
