# REMI Developer Docs > Dispatch deliveries, connect robot fleets and run jobs on REMI, the production layer for physical AI. REMI is the production layer for physical AI: it dispatches work to robots and follows every job to the end. Three APIs share one base URL and one kind of API key. | API | What it is for | Start here | | --- | --- | --- | | Delivery API | Send an order; a robot carries it from pickup to dropoff. | [Delivery API](https://docs.remi.robot.com/delivery) | | Fleet integrations | Connect your own robots so REMI can dispatch to them. | [Fleet integrations](https://docs.remi.robot.com/fleets) | | Engine API | Jobs, nodes and actions: the model under every delivery. | [Engine API](https://docs.remi.robot.com/engine) | - Base URL: `https://api.remi.robot.com/api/v3` - Auth: `Authorization: Bearer `. Ask your Robot.com representative for a key. - New here: [Quick start](https://docs.remi.robot.com/quick-start), then [API basics](https://docs.remi.robot.com/basics). - Agents: [llms.txt](https://docs.remi.robot.com/llms.txt) lists every page; add `.md` to any page URL for Markdown. --- # Quick start > From an API key to a delivery on its way, in five calls. You need an API key with the `delivery` scope. Keep it in your shell: ```bash export REMI_API_KEY='live_sk_...' ``` ## 1. Create your partner Your partner is your account. Your key decides which one; create it once. ```bash curl -X POST 'https://api.remi.robot.com/api/v3/partners' \ -H "Authorization: Bearer $REMI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"name": "Acme Logistics"}' ``` ## 2. Create a location A location is the area your bots serve. `polygon.coordinates` is a flat list of `[lng, lat]` pairs. Keep `data.id` from the response. ```bash curl -X POST 'https://api.remi.robot.com/api/v3/locations' \ -H "Authorization: Bearer $REMI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "full_name": "Downtown Campus", "short_name": "DTC", "country_code": "CO", "city_name": "Bogotá", "polygon": { "type": "Polygon", "coordinates": [[-74.0712, 4.6498], [-74.0521, 4.6498], [-74.0521, 4.6602], [-74.0712, 4.6602], [-74.0712, 4.6498]] } }' ``` ## 3. Add a pickup point A point is a named place in the location, like a kitchen. Tag it `pickup`. ```bash curl -X POST 'https://api.remi.robot.com/api/v3/points' \ -H "Authorization: Bearer $REMI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "external_id": "kitchen-north", "name": "North Kitchen", "lat": 4.6512, "lng": -74.0689, "tags": ["pickup"] }' ``` ## 4. Create a delivery Refer to the pickup by your `external_id` and send the dropoff as coordinates. ```bash curl -X POST 'https://api.remi.robot.com/api/v3/delivery' \ -H "Authorization: Bearer $REMI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "external_id": "order-4821", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "pickup": { "external_id": "kitchen-north" }, "dropoff": { "lat": 4.6602, "lng": -74.0521, "contact": { "name": "Noah", "phone": "+573001234567" } }, "packages": [{ "reference": "bag-1", "items": [{ "name": "Cheeseburger", "quantity": 1 }] }] }' ``` The answer is `201` with the delivery: its `id` (like `ES-5867`), `state: pending` and a `tracker_url` for your customer. REMI assigns a bot and starts it. ## 5. Follow it - Read it with `GET /delivery/{id}`, or `GET /delivery/order-4821?id_type=external`. - At `at_pickup`: `POST /delivery/{id}/load/start` opens the door, `POST /delivery/{id}/load/finish` sends the bot off. - At `at_dropoff`: `unload/start`, then `unload/finish`. The delivery is `delivered`. Next: [Track a delivery](https://docs.remi.robot.com/delivery/lifecycle), [Load and unload](https://docs.remi.robot.com/delivery/loading), [Webhooks](https://docs.remi.robot.com/delivery/webhooks). --- # API basics > Base URL, keys and scopes, ids, errors and pagination: what every endpoint shares. ## Base URL and keys Every REMI API lives under `https://api.remi.robot.com/api/v3`. Send your key on every call: ```http Authorization: Bearer live_sk_... ``` Robot.com issues keys. A key belongs to one namespace (your partner), and everything you create or read is scoped to it. Each key has scopes: | Scope | Opens | | --- | --- | | `delivery` | [Delivery API](https://docs.remi.robot.com/delivery/reference), with partner, locations, points and bots | | `fleet` | [Fleet API](https://docs.remi.robot.com/fleets/reference) | | `engine` | [Engine API](https://docs.remi.robot.com/engine/reference) | ## Errors Errors are [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) `application/problem+json`: ```json { "type": "about:blank", "title": "Conflict", "status": 409, "detail": "Delivery ES-5867 is already finalized", "code": "DELIVERY_FINALIZED", "instance": "/api/v3/delivery/ES-5867/route" } ``` - Branch on `status` and `code`. `detail` is for people and can change. - `params`, when present, holds the values behind the error. - A missing or unknown key is a plain `401` with `{ "message": "Unauthorized" }`. A key without the scope is a `403`. - Every endpoint in the references lists its errors and codes. ## IDs - Deliveries and jobs: like `ES-5867`. Treat them as opaque strings. - Partners, locations and points: 21 letters and digits, like `V1StGXR8Z5jdHi6BmyT2q`. - `external_id` is yours. In a delivery URL, add `?id_type=external` to use it instead of ours. ## Times ISO 8601 in UTC, like `2026-06-17T15:42:00.000Z`. Durations are in milliseconds and distances in meters. A few bot fields are epoch milliseconds: their type in the reference says `number`. ## Pagination Lists that grow take a cursor. Pass the `next_cursor` of one page to get the next; it is null on the last page. The exact parameters are in each list endpoint. ## Changes The major version is in the path (`/api/v3`). Responses can gain new fields: ignore the ones you do not use. --- # For AI agents > Markdown pages, llms.txt and OpenAPI documents for coding agents and LLM tools. Every page here is published twice from the same source: as HTML for people and as Markdown for agents. | What | Where | | --- | --- | | Index of every page | [/llms.txt](https://docs.remi.robot.com/llms.txt) | | Every page in one file | [/llms-full.txt](https://docs.remi.robot.com/llms-full.txt) | | One page as Markdown | Add `.md` to its URL, like [/delivery/webhooks.md](https://docs.remi.robot.com/delivery/webhooks.md) | | OpenAPI 3.1 | [Delivery](https://docs.remi.robot.com/openapi/delivery.json), [Fleet](https://docs.remi.robot.com/openapi/fleet.json), [Fleet partner](https://docs.remi.robot.com/openapi/fleet-partner.json), [Engine](https://docs.remi.robot.com/openapi/engine.json) | The OpenAPI documents are generated from the code that serves each API, and a test fails when the two disagree. They are the most exact source: - Every operation lists its error codes in `x-error-codes` and its key scope in `x-scope`. - Every operation has an `operationId`, which is also its anchor in the references (`/delivery/reference#createDelivery`). ## Give your agent the docs - Give it the `llms.txt` URL and let it fetch the pages it needs. - Or press **Copy page** at the top of a page and paste it in the chat. - To generate a client, point your tool at an OpenAPI document. ## A prompt to start from ```text You are integrating with REMI (https://docs.remi.robot.com). Read https://docs.remi.robot.com/llms.txt, then only the pages you need. For exact request and response shapes use the OpenAPI document of the API, for example https://docs.remi.robot.com/openapi/delivery.json. The API key is in the REMI_API_KEY environment variable. Never print it. Branch on the HTTP status and the problem `code`, never on `detail`. ``` --- # Delivery API > Send an order, a bot carries it from pickup to dropoff. A delivery is one order a robot carries from a pickup to a dropoff. You create it; REMI assigns a bot, drives it, and reports every step. ```steps pending: Waiting for a bot going_to_pickup: Heading to pickup at_pickup: Loading going_to_dropoff: On the way at_dropoff: Unloading delivered: Done ``` ## How it works 1. Register your places once: a [location and its points](https://docs.remi.robot.com/delivery/setup). 2. [Create a delivery](https://docs.remi.robot.com/delivery/reference#createDelivery) with a pickup, a dropoff and its packages. 3. REMI assigns a free bot and starts it. Follow it by polling or with [webhooks](https://docs.remi.robot.com/delivery/webhooks). 4. At the pickup, staff [load the bot](https://docs.remi.robot.com/delivery/loading). At the dropoff, the customer takes the order. ## The calls you will use | Call | When | | --- | --- | | `POST /delivery` | Create a delivery. | | `GET /delivery/{id}` | Read it. | | `POST /delivery/{id}/load/start`, `/load/finish` | At the pickup: open the door, then confirm the load. | | `POST /delivery/{id}/unload/start`, `/unload/finish` | At the dropoff: open the door, then confirm the hand-off. | | `POST /delivery/{id}/cancel` | Call it off. | Everything else is in the [API reference](https://docs.remi.robot.com/delivery/reference). ## Two kinds of delivery - `standard`: a bot delivers it. The default. - `pickup_only`: the customer collects it at the counter, with no bot. See [Pickup-only orders](https://docs.remi.robot.com/delivery/pickup-only). --- # Locations and points > Register the places your deliveries start and end. Deliveries start and end at places. Register them once and refer to them by id. ## Partner [`POST /partners`](https://docs.remi.robot.com/delivery/reference#createPartner) creates your account for your key, once: just a `name`. ## Locations A location is the area your bots serve: a name, a 3 to 4 character `short_name`, a country and a polygon ([`POST /locations`](https://docs.remi.robot.com/delivery/reference#createLocation)). - `polygon.coordinates` is a flat list of `[lng, lat]` pairs, not GeoJSON's nested rings. - [`GET /locations/{id}/paths`](https://docs.remi.robot.com/delivery/reference#getLocationPaths) returns the sidewalks and crossings bots drive there, as GeoJSON. ## Points A point is a named place in a location: a kitchen, a store, an entrance ([`POST /points`](https://docs.remi.robot.com/delivery/reference#createPoint)). - Tag kitchens and stores `pickup`, drop places `dropoff`. Only `pickup` points report [kitchen availability](https://docs.remi.robot.com/delivery/reference#getPointAvailability). - Give each one your own `external_id`, so you never have to store ours. ## Three ways to name a place A delivery's `pickup` and `dropoff` take any of these: | Form | Example | | --- | --- | | Our id | `{ "id": "V1StGXR8Z5jdHi6BmyT2q" }` | | Your id | `{ "external_id": "kitchen-north" }` | | Coordinates | `{ "lat": 4.6602, "lng": -74.0521 }` | - With an id, `name`, `contact` and `azimuth` you send override the point's for that delivery. - Coordinates can be linked to a registered point with `matching`: `exact` (within 5 m), `snap` (nearest within `radius` meters, use its coordinates) or `associate` (nearest within `radius`, keep yours). Add `required: true` to fail when nothing matches. ## Bots [`GET /bots`](https://docs.remi.robot.com/delivery/reference#listBots) lists the bots that serve you. `can_take_delivery` says whether a new delivery could start on one right now. [`GET /bots/{id}`](https://docs.remi.robot.com/delivery/reference#getBot) adds its position, battery and door. --- # Track a delivery > States, polling and the tracker link. ## States A delivery's progress is one field: `state`. | State | Meaning | | --- | --- | | `draft` | Created with `draft: true`. Nothing happens until you publish it with `PATCH` and `draft: false`. | | `pending` | Waiting for a bot. | | `going_to_pickup` | A bot is on its way to the pickup. | | `at_pickup` | The bot is at the pickup. Load it now. | | `going_to_dropoff` | Loaded and on its way. | | `at_dropoff` | The bot is at the dropoff. Unload it now. | | `delivered` | Handed off. Final. | | `going_to_return`, `at_return`, `returned` | Canceled after loading, with a return set: the bot brings the order back. `returned` is final. | | `canceled` | Someone called it off. Final. | | `failed` | It could not be completed. Final. | Pickup-only orders have their own states: see [Pickup-only orders](https://docs.remi.robot.com/delivery/pickup-only). Next to `state`: - `paused` is true while the delivery is on hold. `state` keeps the leg it was on. - `arriving` is true while the bot approaches its next stop. Do not load on it: wait for `at_pickup`. ## Follow a delivery - Poll [`GET /delivery/{id}`](https://docs.remi.robot.com/delivery/reference#getDelivery), or use your own id with `?id_type=external`. - Or get every change at your URL: [Webhooks](https://docs.remi.robot.com/delivery/webhooks). - Give your customer `tracker_url`, a live tracking page. ## Timing - `estimates.pickup` and `estimates.dropoff` say when the bot arrives and finishes at each stop. `source: actual` means it already happened. - [`POST /delivery/eta`](https://docs.remi.robot.com/delivery/reference#estimateDelivery) gives arrival times before you create a delivery. - [`GET /delivery/{id}/route`](https://docs.remi.robot.com/delivery/reference#getDeliveryRoute) returns the path left to drive, to draw on a map. ## Cancel or pause - [`POST /delivery/{id}/cancel`](https://docs.remi.robot.com/delivery/reference#cancelDelivery) works at any state before the end. After loading, with a `return_point` or `options.return_enabled`, the bot brings the order back. - [`POST /delivery/{id}/pause`](https://docs.remi.robot.com/delivery/reference#pauseDelivery) stops the bot and alerts our operations team; [`resume`](https://docs.remi.robot.com/delivery/reference#resumeDelivery) continues. It is not an emergency stop. --- # Load and unload > Open the door, confirm the load, and finish one prep station at a time. At each stop there are two calls: `start` opens the door, `finish` confirms. Only `finish` moves the delivery on. | Stop | Open the door | Confirm | Then | | --- | --- | --- | --- | | Pickup (`at_pickup`) | `POST /delivery/{id}/load/start` | `POST /delivery/{id}/load/finish` | `going_to_dropoff` | | Dropoff (`at_dropoff`) | `POST /delivery/{id}/unload/start` | `POST /delivery/{id}/unload/finish` | `delivered` | - `finish` closes the door and sends the bot on. - `finish` in any other state is a `400`, also right after a successful `finish`. Do not retry it blindly: read the delivery. ## Several prep stations An order can come from several stations, like counters in a food hall. Create one package per station: ```json "packages": [ { "reference": "burger-pkg", "station": "Burger Shop" }, { "reference": "pizza-pkg", "station": "Neapolitan" } ] ``` Each station then finishes its own part with [`POST /delivery/{id}/load/finish/target`](https://docs.remi.robot.com/delivery/reference#finishLoadTarget): ```json { "station": "Burger Shop" } ``` Or one package with `{ "package": "burger-pkg" }`. Each package reports `loaded`, and the bot leaves when every package is loaded. Repeating a target is safe. > After a `409` on the targeted route, do not fall back to the plain `load/finish`: it loads everything and sends the bot off. ## Bots whose lid a person closes On bots with `manual_close_door: true` (see [Get a bot](https://docs.remi.robot.com/delivery/reference#getBot)), `finish` does nothing: the load or unload completes a few seconds after the lid reports closed. Calling `finish` anyway is harmless. ## Dropoff auto-close At locations where Robot.com turned it on, `unload/start` starts a timer. When it runs out, the bot closes its lid, checks the compartment is empty, and completes the delivery as `unload/finish` would. A later `unload/finish` answers `200`. ## The door on its own The Engine API can open or close a bot's door outside this flow: [Open or close a bot door](https://docs.remi.robot.com/engine/reference#setDoorByBot). It needs a key with the `engine` scope. --- # Pickup-only orders > Orders the customer collects, with no bot. A pickup-only order has no bot and no dropoff: the customer collects it. REMI follows the preparation and the hand-off, and gives the customer a tracking page. ```steps pending: Created preparing: Being prepared ready_for_pickup: Ready at the counter picked_up: Collected ``` ## Create one ```json { "mode": "pickup_only", "external_id": "order-4821", "pickup": { "external_id": "kitchen-north", "contact": { "name": "Noah", "phone": "+573001234567" } }, "packages": [{ "reference": "bag-1", "items": [{ "name": "Cheeseburger", "quantity": 1 }] }], "options": { "tracking": { "notify": { "sms": true } } } } ``` - `pickup` must be a registered point. There is no `dropoff`. - For text or email updates, put the customer's phone or email on `pickup.contact`. The point's own contact is never notified. ## Move it along | Call | Moves to | | --- | --- | | [`POST /delivery/{id}/preparation/start`](https://docs.remi.robot.com/delivery/reference#startPreparation) | `preparing` | | [`POST /delivery/{id}/preparation/finish`](https://docs.remi.robot.com/delivery/reference#finishPreparation) | `ready_for_pickup` | | [`POST /delivery/{id}/pickup/confirm`](https://docs.remi.robot.com/delivery/reference#confirmPickup) | `picked_up` | Each call is safe to repeat. The customer can also confirm the pickup from the tracking page. ## Several stations With packages at several stations, call `preparation/finish` and `pickup/confirm` once per station, with `{ "station": "..." }`. The order is `ready_for_pickup` when every station is ready, and `picked_up` when every station handed over. Without a target, a multi-station order answers `400`. --- # Webhooks > Receive every change of a delivery at your URL. Set `options.webhook_url` when you create a delivery, and REMI calls it at every step. Without a URL there are no webhooks. ## The call - `POST` with `Content-Type: application/json`. - The body is the [Delivery](https://docs.remi.robot.com/delivery/reference#type-Delivery), as `GET /delivery/{id}` returns it, not wrapped in `data`. - `event_type` names the event that sent it. `bot.control` says who drives the bot (webhooks only). - Every header in `options.webhook_headers` is sent too. Calls are not signed: put your own secret in a header and check it. ```json { "id": "ES-5867", "state": "at_pickup", "event_type": "node_arrived", "paused": false, "bot": { "id": "4T001" } } ``` ## Events | `event_type` | When | | --- | --- | | `job_created` | The delivery was created. | | `job_bot_assigned` | A bot was assigned. | | `bot_taken` | The bot started serving it. | | `job_started` | It started. | | `job_state_changed` | Any change of state. | | `node_started` | The bot left for the pickup or the dropoff. | | `node_arriving` | The bot is close. | | `node_arrived` | The bot arrived. | | `node_eta_changed` | An arrival time moved. Only with `options.eta_updates`. | | `job_completed` | Delivered or returned. | | `job_canceled` | Canceled. | | `job_failed` | It could not be completed. | Pickup-only orders also send `node_phase_completed` (ready for pickup), `node_completed` (picked up) and, per station, `action_completed`. Decide what to do from `state`, not from `event_type`. ## Order and retries - Calls for one delivery come one at a time, in order. Different deliveries are independent. - A `5xx`, a connection error or no answer within 30 seconds is retried with backoff, up to 5 attempts. Later calls for that delivery wait. - After 5 failed attempts the call is dropped and the next one goes out. Treat webhooks as at least once, with possible gaps, and read `GET /delivery/{id}` to reconcile. - A retry rebuilds the body: live fields such as `state` and the bot's position are current, and `event_type` stays the original event. Answer `2xx` quickly and do the work afterwards: a slow endpoint delays every later call for that order. ## Arrival time updates With `options.eta_updates: true`, `node_eta_changed` also arrives while the bot drives to a stop: when the arrival time moved 90 seconds or more, or after 5 minutes without one, at most once a minute. The new time is in `estimates.pickup.arrival_at` or `estimates.dropoff.arrival_at`. --- # Delivery API reference > Every endpoint of the Delivery API, with schemas, errors and examples. Create deliveries that a robot carries from a pickup to a dropoff, and follow them to the end. - Base URL: `https://api.remi.robot.com/api/v3` - Auth: An API key with the `delivery` scope, sent as `Authorization: Bearer `. Ask your Robot.com representative for one. - OpenAPI document: https://docs.remi.robot.com/openapi/delivery.json ## Deliveries Create, read, change and cancel deliveries. ### List deliveries `GET /delivery` (scope `delivery`) Newest first by default. Pass `pagination.next_cursor` as `cursor` to get the next page; it is null on the last page. Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | 1 to 1000. Default `100`. | | `cursor` | `string` | no | | | `active` | `'true' \| 'false'` | no | | | `external_id` | `string` | no | | | `sort` | `'asc' \| 'desc'` | no | Default `"desc"`. | Response 200: A page of deliveries. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery[]` | yes | | | `pagination` | `object` | yes | | | `pagination.next_cursor` | `string \| null` | yes | | | `pagination.limit` | `number` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid query, for example `active` other than `true` or `false`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | ### Create a delivery `POST /delivery` (scope `delivery`) Creates the delivery and returns it. REMI assigns a bot and starts it. - A point is a registered `id`, your `external_id`, or `lat` + `lng`. - `dropoff` is required for `standard` and not allowed for `pickup_only`. - Any error means no delivery exists, so retrying is safe. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | no | Display name, for example the order number. | | `location_id` | `string` | no | Optional when a point is a registered one. | | `draft` | `boolean \| null` | no | Create without starting it. Publish with `PATCH` and `draft: false`. | | `mode` | `'standard' \| 'pickup_only' \| null` | no | Delivery mode. Defaults to standard (bot delivery). | | `tags` | `string[] \| null` | no | | | `options` | `DeliveryOptionsInput` | no | | | `external_id` | `string \| null` | no | Your id. Unique among your active deliveries; use it with `id_type=external`. | | `pickup` | `PointInput` | yes | | | `dropoff` | `PointInput \| null` | no | Required for `standard`, not allowed for `pickup_only`. | | `return_point` | `PointInput \| null` | no | Where a canceled, loaded order goes back to. Turns the return on. | | `packages` | `PackageInput[] \| null` | no | | | `deliver_by` | `string (date-time) \| null` | no | Deadline. Not with `require_available_bot`. | | `metadata` | `Record \| null` | no | Free-form, returned as sent. | Response 201: The created delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body, an unresolvable point, or `require_available_bot` together with `deliver_by`. | | 400 | `INVALID_BOT` | The bot in `options.bots` does not exist for you. | | 400 | `PICKUP_ONLY_CONTACT_REQUIRED` | Pickup-only with tracking notifications but no pickup contact phone or email. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 409 | `NO_AVAILABLE_BOT` | With `require_available_bot`: no bot is free. | | 409 | `BOT_UNAVAILABLE` | The pinned bot is not connected or not available. | | 409 | `BOT_BUSY` | The pinned bot is on another delivery. | | 501 | | More than one bot in `options.bots`. | Example request: ```json { "name": "Order #4821", "external_id": "order-4821", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "pickup": { "id": "V1StGXR8Z5jdHi6BmyT2q", "contact": { "name": "Ana", "phone": "+573001234567" } }, "dropoff": { "lat": 4.6602, "lng": -74.0521, "matching": { "mode": "snap", "radius": 25 } }, "packages": [ { "reference": "burger-pkg", "station": "Burger Shop", "items": [ { "name": "Cheeseburger", "quantity": 1 } ] } ], "options": { "webhook_url": "https://example.com/hooks/remi" } } ``` Example response: ```json { "data": { "id": "ES-5867", "name": "Order #4821", "draft": false, "mode": "standard", "state": "pending", "paused": false, "bot": null, "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "arriving": false, "arriving_at": "2026-06-17T15:51:00.000Z", "options": { "bots": null, "bot_tags": null, "require_available_bot": false, "webhook_url": "https://example.com/hooks/remi", "webhook_headers": null, "return_enabled": false, "eta_updates": false }, "external_id": "order-4821", "pickup": { "id": "V1StGXR8Z5jdHi6BmyT2q", "name": "Downtown Store", "lat": 4.6512, "lng": -74.0689, "azimuth": null, "contact": { "name": "Ana", "phone": "+573001234567", "email": null }, "matching": null }, "dropoff": { "id": null, "name": "dropoff", "lat": 4.6602, "lng": -74.0521, "azimuth": null, "contact": null, "matching": { "mode": "snap", "radius": 25 } }, "return_point": null, "packages": [ { "reference": "burger-pkg", "items": [ { "name": "Cheeseburger", "quantity": 1, "description": null, "picture_url": null, "metadata": null } ], "dimensions": null, "weight": null, "metadata": null, "station": "Burger Shop", "loaded": false } ], "deliver_by": null, "created_at": "2026-06-17T15:42:00.000Z", "metadata": null, "event_type": null, "estimates": { "distance": 2980, "duration": 2483000, "pickup": { "arrival_at": "2026-06-17T15:51:00.000Z", "completion_at": "2026-06-17T15:54:00.000Z", "source": "derived", "unknown_reason": null }, "dropoff": { "arrival_at": "2026-06-17T16:12:00.000Z", "completion_at": "2026-06-17T16:14:00.000Z", "source": "derived", "unknown_reason": null }, "scheduled_at": null, "target_completion_at": null }, "tracker_url": "https://track.kiwibot.com/t/A1b2C3d4E5", "scheduled": false, "cancellation_reason": null, "incomplete_reason": null } } ``` ### Estimate arrival times `POST /delivery/eta` (scope `delivery`) Two modes: - `pickup` + `dropoff`: arrival of the nearest free bot, without creating anything. Travel time only. - `delivery_id`: the current estimate of an existing delivery, including load and unload time. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `delivery_id` | `string` | no | An existing delivery. When set, the points are ignored. | | `id_type` | `'external'` | no | Treat `delivery_id` as your `external_id`. | | `pickup` | `PointInput` | no | | | `dropoff` | `PointInput` | no | | | `location_id` | `string` | no | Needed when neither point is a registered one. | Response 200: Arrival times. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `DeliveryEta` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Neither `delivery_id` nor both points, or points with no resolvable location. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 403 | | The location is not yours. | | 404 | | No delivery with that `delivery_id`. | | 409 | `NO_AVAILABLE_BOT` | No connected, free bot with at least 20% battery. | | 422 | | No route between the points. | Example request: ```json { "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "pickup": { "lat": 4.6512, "lng": -74.0689 }, "dropoff": { "lat": 4.6602, "lng": -74.0521 } } ``` Example response: ```json { "data": { "bot_id": "4T001", "pickup_eta": "2026-06-17T15:51:00.000Z", "dropoff_eta": "2026-06-17T16:12:00.000Z" } } ``` ### Get a delivery `GET /delivery/{id}` (scope `delivery`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | Example response: ```json { "data": { "id": "ES-5867", "name": "Order #4821", "draft": false, "mode": "standard", "state": "going_to_pickup", "paused": false, "bot": { "id": "4T001", "lat": 4.6498, "lng": -74.0712, "door_status": "closed", "control": null }, "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "arriving": false, "arriving_at": "2026-06-17T15:51:00.000Z", "options": { "bots": null, "bot_tags": null, "require_available_bot": false, "webhook_url": "https://example.com/hooks/remi", "webhook_headers": null, "return_enabled": false, "eta_updates": false }, "external_id": "order-4821", "pickup": { "id": "V1StGXR8Z5jdHi6BmyT2q", "name": "Downtown Store", "lat": 4.6512, "lng": -74.0689, "azimuth": null, "contact": { "name": "Ana", "phone": "+573001234567", "email": null }, "matching": null }, "dropoff": { "id": null, "name": "dropoff", "lat": 4.6602, "lng": -74.0521, "azimuth": null, "contact": null, "matching": { "mode": "snap", "radius": 25 } }, "return_point": null, "packages": [ { "reference": "burger-pkg", "items": [ { "name": "Cheeseburger", "quantity": 1, "description": null, "picture_url": null, "metadata": null } ], "dimensions": null, "weight": null, "metadata": null, "station": "Burger Shop", "loaded": false } ], "deliver_by": null, "created_at": "2026-06-17T15:42:00.000Z", "metadata": null, "event_type": null, "estimates": { "distance": 2980, "duration": 2483000, "pickup": { "arrival_at": "2026-06-17T15:51:00.000Z", "completion_at": "2026-06-17T15:54:00.000Z", "source": "derived", "unknown_reason": null }, "dropoff": { "arrival_at": "2026-06-17T16:12:00.000Z", "completion_at": "2026-06-17T16:14:00.000Z", "source": "derived", "unknown_reason": null }, "scheduled_at": null, "target_completion_at": null }, "tracker_url": "https://track.kiwibot.com/t/A1b2C3d4E5", "scheduled": false, "cancellation_reason": null, "incomplete_reason": null } } ``` ### Update a delivery `PATCH /delivery/{id}` (scope `delivery`) Supported today: change `external_id`, and publish a draft with `draft: false` (add `scheduled_at` to schedule it). Other fields answer 501. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | no | | | `draft` | `boolean \| null` | no | | | `options` | `DeliveryOptionsInput` | no | | | `external_id` | `string \| null` | no | | | `pickup` | `{ name?: string, lat?: number, lng?: number, azimuth?: integer \| null, contact?: { name?: string \| null, phone?: string \| null, email?: string (email) \| null } \| null } \| { id: string }` | no | | | `dropoff` | `{ name?: string, lat?: number, lng?: number, azimuth?: integer \| null, contact?: { name?: string \| null, phone?: string \| null, email?: string (email) \| null } \| null } \| { id: string }` | no | | | `return_point` | `{ name?: string, lat?: number, lng?: number, azimuth?: integer \| null, contact?: { name?: string \| null, phone?: string \| null, email?: string (email) \| null } \| null } \| { id: string } \| null` | no | | | `packages` | `PackageInput[] \| null` | no | | | `deliver_by` | `string (date-time) \| null` | no | | | `scheduled_at` | `string (date-time) \| null` | no | | | `metadata` | `Record \| null` | no | | Response 200: The updated delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | `draft: false` on a delivery that is not a draft, or a point that can no longer change. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 501 | | The field cannot be updated yet. | Example request: ```json { "draft": false, "scheduled_at": "2026-06-17T23:30:00.000Z" } ``` ### Get the remaining route `GET /delivery/{id}/route` (scope `delivery`) The path the bot still has to drive, from its last position through the remaining stops. Before a bot starts, it begins at the pickup. Poll it: nothing is pushed when the bot reroutes. A result can be up to 10 seconds old (`computed_at`). Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The route. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `DeliveryRoute` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 409 | `PICKUP_ONLY_DELIVERY` | Pickup-only deliveries have no bot. | | 409 | `DELIVERY_FINALIZED` | The delivery is delivered, returned, canceled or failed. | | 409 | `BOT_POSITION_UNKNOWN` | No bot position from the last 30 minutes. Retry shortly. | Example response: ```json { "data": { "source": "estimated", "mapped": true, "computed_at": "2026-06-17T15:48:10.000Z", "position_recorded_at": "2026-06-17T15:48:08.000Z", "distance": 2980, "duration": 2483000, "points": [ [ 4.6498, -74.0712 ], [ 4.6512, -74.0689 ], [ 4.6577, -74.0571 ], [ 4.6602, -74.0521 ] ], "stops": [ { "name": "pickup", "lat": 4.6512, "lng": -74.0689, "point_index": 1 }, { "name": "dropoff", "lat": 4.6602, "lng": -74.0521, "point_index": 3 } ] } } ``` ### Cancel a delivery `POST /delivery/{id}/cancel` (scope `delivery`) With a return configured and the order already loaded, the bot brings it back and the delivery ends `returned`. Pickup-only: stations already handed over stay handed over. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: Canceled. | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | `true` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | Example response: ```json { "success": true } ``` ### Pause a delivery `POST /delivery/{id}/pause` (scope `delivery`) Stops the bot where it is and alerts our operations team. Not an emergency stop: for a physical emergency, call operations too. Pausing again is a no-op. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Shown to operations. Cut to 200 characters. | Response 200: The delivery, with `paused: true`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 409 | `DELIVERY_NOT_IN_PROGRESS` | Only a delivery in progress can be paused. | | 409 | `STOP_NOT_SUPPORTED` | This bot or delivery cannot be stopped through the API. Call operations. | | 409 | `OPERATOR_IN_CONTROL` | An operator is driving the bot. Call operations. | Example request: ```json { "reason": "The robot is blocking a building entrance" } ``` ### Resume a delivery `POST /delivery/{id}/resume` (scope `delivery`) Resumes a delivery you paused. A pause made by our operations team is theirs to resume. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Shown to operations. Cut to 200 characters. | Response 200: The delivery, with `paused: false`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `RESUME_JOB_NO_BOT` | The delivery no longer has a bot. Call operations. | | 400 | `RESUME_JOB_INVALID_STATE` | The delivery changed at the same moment. Read it again. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 409 | `DELIVERY_NOT_PAUSED` | The delivery is not paused. | | 409 | `PAUSED_BY_OPERATIONS` | Our operations team paused it. | | 409 | `OPERATOR_IN_CONTROL` | An operator is driving the bot. Call operations. | ## Loading Open the bot door and confirm loads and hand-offs. ### Open the door to load `POST /delivery/{id}/load/start` (scope `delivery`) At `at_pickup`: opens the bot door. The state does not change. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | The delivery is not `at_pickup`, or has no bot. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery in progress with this id. | ### Finish loading `POST /delivery/{id}/load/finish` (scope `delivery`) Confirms the whole pickup is loaded: REMI closes the door and the delivery moves to `going_to_dropoff`. Takes no body. To finish one station or package, use the targeted route. On a bot whose lid a person closes (`manual_close_door`), this does nothing: the load completes when the lid closes. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | The delivery is not `at_pickup` (also when it already left), or has no bot. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery in progress with this id. | ### Finish loading one station or package `POST /delivery/{id}/load/finish/target` (scope `delivery`) Completes only the `package` or `station` you name. The bot leaves when every package is loaded. Repeating it is a no-op. On a 409, do not fall back to the untargeted finish: it would load everything. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `package` | `string` | no | A package `reference`. | | `station` | `string` | no | Every package of this station. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | The delivery is not `at_pickup`, or has no bot. | | 400 | `LOAD_TARGET_AMBIGUOUS` | Both `package` and `station` were sent. | | 400 | `LOAD_TARGET_REQUIRED` | No target, and the delivery has several load actions. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery in progress with this id. | | 404 | `LOAD_TARGET_NOT_FOUND` | Unknown `package` or `station`. | | 409 | `LOAD_TARGET_NOT_LOADABLE` | The target is paused, failed, skipped or canceled. Nothing changed. | | 409 | `LOAD_TARGET_NO_ACTIONS` | The target has nothing to load. Nothing changed. | Example request: ```json { "station": "Burger Shop" } ``` ### Open the door to unload `POST /delivery/{id}/unload/start` (scope `delivery`) At `at_dropoff`: opens the bot door. The state does not change. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | The delivery is not `at_dropoff`, or has no bot. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery in progress with this id. | ### Finish unloading `POST /delivery/{id}/unload/finish` (scope `delivery`) Confirms the hand-off: the delivery is `delivered`. On a bot whose lid a person closes (`manual_close_door`), this does nothing: the unload completes when the lid closes. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | The delivery is not `at_dropoff`, or has no bot. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery in progress with this id. | ## Pickup-only Milestones of orders the customer collects, with no bot. ### Start preparation `POST /delivery/{id}/preparation/start` (scope `delivery`) Pickup-only. Moves the delivery to `preparing`. Repeating it is a no-op. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Not a pickup-only delivery. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 409 | `MILESTONE_OUT_OF_ORDER` | The delivery ended before this milestone. | ### Finish preparation `POST /delivery/{id}/preparation/finish` (scope `delivery`) Pickup-only. Marks the order, or one `station` or `package` of it, ready. With several stations, send one call per station; the delivery is `ready_for_pickup` when all are ready. Repeating it is a no-op. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `package` | `string` | no | A package `reference`. | | `station` | `string` | no | Every package of this station. | | `all_stations` | `boolean` | no | Accepted, but has no effect today. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `MILESTONE_TARGET_AMBIGUOUS` | Both `package` and `station` were sent. | | 400 | `MILESTONE_TARGET_REQUIRED` | The order has several stations or packages and no target was sent. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 404 | `MILESTONE_TARGET_NOT_FOUND` | Unknown `package` or `station`. | | 409 | `MILESTONE_OUT_OF_ORDER` | A previous milestone is missing, or the delivery ended without this one. | | 409 | `MILESTONE_TARGET_NOT_LOADABLE` | The target is paused, failed, skipped or canceled. Nothing changed. | Example request: ```json { "station": "Burger Shop" } ``` ### Confirm pickup `POST /delivery/{id}/pickup/confirm` (scope `delivery`) Pickup-only. The customer took the order, or one `station` or `package` of it. The delivery is `picked_up` when every station is. The customer can also confirm from the tracker page. Repeating it is a no-op. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. Resolves only active deliveries. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `package` | `string` | no | A package `reference`. | | `station` | `string` | no | Every package of this station. | | `all_stations` | `boolean` | no | Accepted, but has no effect today. | Response 200: The delivery. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Delivery` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `MILESTONE_TARGET_AMBIGUOUS` | Both `package` and `station` were sent. | | 400 | `MILESTONE_TARGET_REQUIRED` | The order has several stations or packages and no target was sent. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No delivery with this id in your namespace (by `external_id`: no active one). | | 404 | `MILESTONE_TARGET_NOT_FOUND` | Unknown `package` or `station`. | | 409 | `MILESTONE_OUT_OF_ORDER` | A previous milestone is missing, or the delivery ended without this one. | | 409 | `MILESTONE_TARGET_NOT_LOADABLE` | The target is paused, failed, skipped or canceled. Nothing changed. | Example request: ```json { "station": "Burger Shop" } ``` ## Kitchen availability Whether a kitchen can take orders right now. ### Check several kitchens `GET /delivery/points/availability` (scope `delivery`) Send exactly one of `location_id` (every pickup point there) or `point_ids` (up to 100). Unknown ids come back with `reason: unknown_point`. Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `location_id` | `string` | no | | | `point_ids` | `string` | no | | | `id_type` | `'external'` | no | | Response 200: One entry per point. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `PointAvailability[]` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Both or neither filter, more than 100 ids, or `id_type` with `location_id`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | Example response: ```json { "data": [ { "point_id": "V1StGXR8Z5jdHi6BmyT2q", "external_id": "kitchen-north", "name": "North Kitchen", "available": true, "last_seen_at": "2026-06-17T15:40:00.000Z", "reason": "ok" }, { "point_id": "9QzXcV5bNm1LkJhGfDsAp", "external_id": "kitchen-south", "name": "South Kitchen", "available": false, "reason": "no_session" } ] } ``` ### Check one kitchen `GET /delivery/points/{id}/availability` (scope `delivery`) Whether the kitchen at this pickup point can take orders now: its tablet session is live. Fails closed: when unsure, `available` is false. Always 200 for a known caller. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Point id (ours, not `external_id`). | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `string` | no | | Response 200: The availability. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Availability` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | `id_type` was sent. Use the batch endpoint to look up by `external_id`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | Example response: ```json { "data": { "available": true, "last_seen_at": "2026-06-17T15:40:00.000Z", "reason": "ok" } } ``` ## Partner Your partner account. Each API key has one, created once. ### Get your partner `GET /partners` (scope `delivery`) Response 200: Your partner. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Partner` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | You have not created your partner yet. Create it with `POST /partners`. | Example response: ```json { "data": { "id": "V1StGXR8Z5jdHi6BmyT2q", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "namespace": "partner_acme", "name": "Acme Logistics", "enabled": true } } ``` ### Create your partner `POST /partners` (scope `delivery`) Creates the partner of your API key, which can have only one. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Display name. Must be unique. | Response 201: The created partner. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Partner` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body, for example a missing `name`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 409 | | Your key already has a partner. Use `GET` or `PATCH /partners`. | | 409 | `PARTNER_NAME_TAKEN` | `name` is already used by another partner. | Example request: ```json { "name": "Acme Logistics" } ``` Example response: ```json { "data": { "id": "V1StGXR8Z5jdHi6BmyT2q", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "namespace": "partner_acme", "name": "Acme Logistics", "enabled": true } } ``` ### Update your partner `PATCH /partners` (scope `delivery`) Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Display name. Must be unique. | Response 200: Your updated partner. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Partner` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body, or no field to update. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | You have not created your partner yet. Create it with `POST /partners`. | | 409 | `PARTNER_NAME_TAKEN` | `name` is already used by another partner. | Example request: ```json { "name": "Acme Logistics US" } ``` Example response: ```json { "data": { "id": "V1StGXR8Z5jdHi6BmyT2q", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "namespace": "partner_acme", "name": "Acme Logistics US", "enabled": true } } ``` ## Locations The operating areas of your partner, and the paths our bots can drive in them. ### List locations `GET /locations` (scope `delivery`) Response 200: Every location of your partner. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Location[]` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | Example response: ```json { "data": [ { "id": "7Nk2QhVpXrLmT4wZaBcDe", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "full_name": "Downtown Campus", "short_name": "DTC", "country_code": "CO", "city_name": "Bogotá", "state_name": null, "time_zone": "America/Bogota", "enabled": true, "polygon": { "type": "Polygon", "coordinates": [ [ -74.0712, 4.6498 ], [ -74.0521, 4.6498 ], [ -74.0521, 4.6602 ], [ -74.0712, 4.6602 ], [ -74.0712, 4.6498 ] ] }, "availability_intervals": null } ] } ``` ### Create a location `POST /locations` (scope `delivery`) Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `full_name` | `string` | yes | Display name. Must be unique. | | `short_name` | `string` | yes | Short code, 3 to 4 characters. Must be unique. Up to 4 characters. | | `country_code` | `string` | yes | ISO 3166-1 alpha-2, for example `US`. Up to 2 characters. | | `city_name` | `string` | no | | | `state_name` | `string` | no | | | `time_zone` | `string` | no | IANA time zone, for example `America/Bogota`. Defaults to `America/Bogota`. | | `polygon` | `object` | yes | Operating area. `coordinates` is a flat list of `[lng, lat]` pairs, not the nested rings of standard GeoJSON. | | `polygon.type` | `'Polygon'` | yes | | | `polygon.coordinates` | `number[][]` | yes | | Response 201: The created location. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Location` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body, for example a `short_name` that is not 3 to 4 characters or a `polygon` with nested rings. | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 409 | `LOCATION_NAME_TAKEN` | `full_name` or `short_name` is already used: names are unique across all partners. `params.field` says which. | Example request: ```json { "full_name": "Downtown Campus", "short_name": "DTC", "country_code": "CO", "city_name": "Bogotá", "polygon": { "type": "Polygon", "coordinates": [ [ -74.0712, 4.6498 ], [ -74.0521, 4.6498 ], [ -74.0521, 4.6602 ], [ -74.0712, 4.6602 ], [ -74.0712, 4.6498 ] ] } } ``` Example response: ```json { "data": { "id": "7Nk2QhVpXrLmT4wZaBcDe", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "full_name": "Downtown Campus", "short_name": "DTC", "country_code": "CO", "city_name": "Bogotá", "state_name": null, "time_zone": "America/Bogota", "enabled": true, "polygon": { "type": "Polygon", "coordinates": [ [ -74.0712, 4.6498 ], [ -74.0521, 4.6498 ], [ -74.0521, 4.6602 ], [ -74.0712, 4.6602 ], [ -74.0712, 4.6498 ] ] }, "availability_intervals": null } } ``` ### Get a location `GET /locations/{id}` (scope `delivery`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Location id. | Response 200: The location. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Location` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No location with this id in your partner. | Example response: ```json { "data": { "id": "7Nk2QhVpXrLmT4wZaBcDe", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "full_name": "Downtown Campus", "short_name": "DTC", "country_code": "CO", "city_name": "Bogotá", "state_name": null, "time_zone": "America/Bogota", "enabled": true, "polygon": { "type": "Polygon", "coordinates": [ [ -74.0712, 4.6498 ], [ -74.0521, 4.6498 ], [ -74.0521, 4.6602 ], [ -74.0712, 4.6602 ], [ -74.0712, 4.6498 ] ] }, "availability_intervals": null } } ``` ### Update a location `PATCH /locations/{id}` (scope `delivery`) Send only the fields you change. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Location id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `full_name` | `string` | no | Display name. Must be unique. | | `short_name` | `string` | no | Short code, 3 to 4 characters. Must be unique. Up to 4 characters. | | `country_code` | `string` | no | ISO 3166-1 alpha-2, for example `US`. Up to 2 characters. | | `city_name` | `string` | no | | | `state_name` | `string` | no | | | `time_zone` | `string` | no | IANA time zone, for example `America/Bogota`. Defaults to `America/Bogota`. | | `polygon` | `object` | no | Operating area. `coordinates` is a flat list of `[lng, lat]` pairs, not the nested rings of standard GeoJSON. | | `polygon.type` | `'Polygon'` | yes | | | `polygon.coordinates` | `number[][]` | yes | | Response 200: The updated location. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Location` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body, or no field to update. | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No location with this id in your partner. | | 409 | `LOCATION_NAME_TAKEN` | `full_name` or `short_name` is already used: names are unique across all partners. `params.field` says which. | Example request: ```json { "city_name": "Bogotá D.C." } ``` Example response: ```json { "data": { "id": "7Nk2QhVpXrLmT4wZaBcDe", "external_id": "ext_8Fh2KpLm4NqRs7TvWxYz1", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "full_name": "Downtown Campus", "short_name": "DTC", "country_code": "CO", "city_name": "Bogotá D.C.", "state_name": null, "time_zone": "America/Bogota", "enabled": true, "polygon": { "type": "Polygon", "coordinates": [ [ -74.0712, 4.6498 ], [ -74.0521, 4.6498 ], [ -74.0521, 4.6602 ], [ -74.0712, 4.6602 ], [ -74.0712, 4.6498 ] ] }, "availability_intervals": null } } ``` ### Get the paths of a location `GET /locations/{id}/paths` (scope `delivery`) The paths our bots can drive at the location: sidewalks, crossings and driveways, as a GeoJSON FeatureCollection of LineStrings. A location with no map returns an empty collection. Not paginated; a change to the map can take up to 10 minutes to appear. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Location id. | Response 200: The path network. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `LocationPaths` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No location with this id in your partner. | | 503 | | The map service is temporarily unavailable. Retry later. | Example response: ```json { "data": { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [ -74.0712, 4.6498 ], [ -74.0689, 4.6512 ], [ -74.0671, 4.6527 ] ] }, "properties": { "id": 1042, "kind": "sidewalk" } }, { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [ -74.0671, 4.6527 ], [ -74.067, 4.6531 ] ] }, "properties": { "id": 1043, "kind": "crossing" } } ] } } ``` ## Points Named coordinates inside a location, used as pickup and dropoff anchors. ### List points `GET /points` (scope `delivery`) The points of one location. Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `location_id` | `string` | yes | A location you own. | Response 200: The points of the location. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Point[]` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | `location_id` is missing. | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No location with this id in your partner. | Example response: ```json { "data": [ { "id": "Qm3LxYtR9vBnKs2FdHjWp", "external_id": "kitchen-north", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "name": "North Kitchen", "description": null, "lat": 4.6512, "lng": -74.0689, "azimuth": null, "tags": [ "pickup" ] } ] } ``` ### Create a point `POST /points` (scope `delivery`) Adds a point to one of your locations. A point without the `pickup` tag is never reported as available by the kitchen availability check (`not_pickup`). Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `location_id` | `string` | yes | A location you own. | | `lat` | `number` | yes | -90 to 90. | | `lng` | `number` | yes | -180 to 180. | | `name` | `string` | no | | | `description` | `string` | no | | | `azimuth` | `integer` | no | Approach heading in degrees, 0 to 360. 0 to 360. | | `external_id` | `string` | no | Your own id for the point. Must be unique across your points. Generated when omitted. | | `tags` | `('pickup' \| 'dropoff')[]` | no | Roles of the point: `pickup` (kitchen, where orders start) and `dropoff` (delivery destination). Up to 20 items. | Response 201: The created point. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Point` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body, for example a `lat` out of range or a tag other than `pickup` or `dropoff`. | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No location with this id in your partner. | | 409 | `POINT_EXTERNAL_ID_TAKEN` | `external_id` is already used by another of your points. | Example request: ```json { "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "external_id": "kitchen-north", "name": "North Kitchen", "lat": 4.6512, "lng": -74.0689, "tags": [ "pickup" ] } ``` Example response: ```json { "data": { "id": "Qm3LxYtR9vBnKs2FdHjWp", "external_id": "kitchen-north", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "name": "North Kitchen", "description": null, "lat": 4.6512, "lng": -74.0689, "azimuth": null, "tags": [ "pickup" ] } } ``` ### Get a point `GET /points/{id}` (scope `delivery`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Point id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. | Response 200: The point. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Point` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No point with this id in your partner (by `external_id`: no point with this value). | Example response: ```json { "data": { "id": "Qm3LxYtR9vBnKs2FdHjWp", "external_id": "kitchen-north", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "name": "North Kitchen", "description": null, "lat": 4.6512, "lng": -74.0689, "azimuth": null, "tags": [ "pickup" ] } } ``` ### Update a point `PATCH /points/{id}` (scope `delivery`) Send only the fields you change. `tags` replaces the `pickup` and `dropoff` roles, so omit it to keep them. A point cannot move to another location. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Point id, or your `external_id` with `id_type=external`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id_type` | `'external'` | no | Treat `{id}` as your `external_id`. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `lat` | `number` | no | -90 to 90. | | `lng` | `number` | no | -180 to 180. | | `name` | `string` | no | | | `description` | `string` | no | | | `azimuth` | `integer` | no | Approach heading in degrees, 0 to 360. 0 to 360. | | `external_id` | `string` | no | Your own id for the point. Must be unique across your points. Generated when omitted. | | `tags` | `('pickup' \| 'dropoff')[]` | no | The complete set of roles. It replaces the current `pickup` and `dropoff` roles, so send every role you want to keep. Up to 20 items. | Response 200: The updated point. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Point` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body: no field to update, an unknown field (such as `location_id`), or an empty `tags`. | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No point with this id in your partner (by `external_id`: no point with this value). | | 409 | `POINT_EXTERNAL_ID_TAKEN` | `external_id` is already used by another of your points. | Example request: ```json { "tags": [ "pickup", "dropoff" ] } ``` Example response: ```json { "data": { "id": "Qm3LxYtR9vBnKs2FdHjWp", "external_id": "kitchen-north", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "name": "North Kitchen", "description": null, "lat": 4.6512, "lng": -74.0689, "azimuth": null, "tags": [ "dropoff", "pickup" ] } } ``` ## Bots Status, live telemetry, camera and remote stops of your bots. ### List bots `GET /bots` (scope `delivery`) Your bots: assigned to your partner, or with no partner and at one of your locations. Connected bots come first. No telemetry or control. Response 200: Your bots. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Bot[]` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | Example response: ```json { "data": [ { "id": "4T001", "commercial_name": "Bot 12", "available": true, "can_take_delivery": true, "availability_status": "available", "connected": true, "operational": true, "autonomy_enabled": true, "manual_close_door": false, "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "current_action": null, "current_job_id": null, "reserved_job_id": null, "current_target_point_id": null, "last_connection_event_at": 1781710800000, "last_operational_event_at": 1781710200000 } ] } ``` ### Get a bot `GET /bots/{id}` (scope `delivery`) The bot with its last telemetry and who controls it. Check `recorded_at` and `connected` before trusting a position. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Bot id, for example `4T001`. | Response 200: The bot. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `BotDetail` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No bot with this id among your bots. | Example response: ```json { "data": { "id": "4T001", "commercial_name": "Bot 12", "available": true, "can_take_delivery": true, "availability_status": "available", "connected": true, "operational": true, "autonomy_enabled": true, "manual_close_door": false, "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "partner_id": "V1StGXR8Z5jdHi6BmyT2q", "current_action": null, "current_job_id": null, "reserved_job_id": null, "current_target_point_id": null, "last_connection_event_at": 1781710800000, "last_operational_event_at": 1781710200000, "telemetry": { "position": { "lat": 4.6498, "lng": -74.0712, "heading": 87.5, "recorded_at": "2026-06-17T15:41:01.000Z" }, "battery": { "percentage": 82, "charging": false, "recorded_at": "2026-06-17T15:40:52.000Z" }, "speed": { "mps": 0.84, "recorded_at": "2026-06-17T15:41:00.500Z" }, "door": { "status": "closed", "recorded_at": "2026-06-17T15:40:58.000Z" } }, "control": { "mode": "autonomous", "since": null } } } ``` ### Watch a bot live `POST /bots/{id}/video` (scope `delivery`) Returns a short-lived link to the bot camera, to open or embed. Request one link per viewer. Works with a `delivery` key for your bots, or a `fleet` key for the bots of your fleet. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Bot id, for example `4T001`. | Response 200: The player link. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.url` | `string` | yes | Player link with its own viewing credential. Do not log it. | | `data.expires_at` | `string (date-time)` | yes | Open the link before this time. A player that is already open keeps playing. | | `data.live` | `boolean` | yes | False when the camera is not sending now. The player starts when it does. | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No bot with this id that your key may watch. | | 409 | | The bot has no live video source. | | 503 | | Live video is temporarily unavailable. Retry later. | Example response: ```json { "data": { "url": "https://remi.kiwi/live#s=miami&b=4T001&t=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ2aWV3ZXIifQ.c2lnbmF0dXJl", "expires_at": "2027-06-17T23:40:00.000Z", "live": true } } ``` ### Stop a bot `POST /bots/{id}/stop` (scope `delivery`) Asks a bot that is not on a delivery in progress to halt where it is. It does not hold the bot: its next delivery moves it. Not a hardware emergency stop. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Bot id, for example `4T001`. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Optional note. Cut to 200 characters. | Response 200: The stop was sent. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.bot_id` | `string` | yes | | | `data.stopped` | `true` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No bot with this id among your bots. | | 409 | `BOT_OFFLINE` | The bot is offline. | | 409 | `STOP_NOT_SUPPORTED` | This robot cannot be stopped through the API. | | 409 | `ACTIVE_DELIVERY` | The bot is on a delivery in progress, and a stop would not hold. Pause the delivery instead. `params.delivery_id` names it when it is yours. | Example request: ```json { "reason": "Blocking a door" } ``` Example response: ```json { "data": { "bot_id": "4T001", "stopped": true } } ``` ### Hard stop a bot `POST /bots/{id}/hard_stop` (scope `delivery`) Sends the stop our teleoperators use: pressed, then released after one second. It works while the bot is on a delivery (operations is alerted) and does not pause the delivery. Not a hardware emergency stop: in an emergency call operations. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Bot id, for example `4T001`. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Why you stopped it. Operations sees it when the bot is on a delivery. Cut to 200 characters. | Response 200: The stop was sent and released. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.bot_id` | `string` | yes | | | `data.hard_stopped` | `true` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Your partner does not exist yet. Create it with `POST /partners`. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `delivery` scope. | | 404 | | No bot with this id among your bots. | | 409 | `BOT_OFFLINE` | The bot is offline. | | 409 | `STOP_NOT_SUPPORTED` | This robot cannot take a hard stop through the API. | Example request: ```json { "reason": "Person in the path" } ``` Example response: ```json { "data": { "bot_id": "4T001", "hard_stopped": true } } ``` ## Types ### Problem | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | `string` | yes | Always `about:blank`. | | `title` | `string` | yes | The HTTP status text. | | `status` | `integer` | yes | -9007199254740991 to 9007199254740991. | | `detail` | `string` | yes | Human-readable. Do not parse it: branch on `code`. | | `instance` | `string` | yes | The request path. | | `code` | `string` | no | Stable machine-readable error code, when the error has one. | | `params` | `Record` | no | Values that explain the error, keyed by name. | ### Delivery | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Delivery id, usually like `ES-5867`. Treat it as an opaque string. | | `name` | `string \| null` | yes | | | `draft` | `boolean` | yes | True while a draft. Publish with `PATCH` and `draft: false`. | | `mode` | `'standard' \| 'pickup_only'` | yes | `standard`: a bot delivers. `pickup_only`: the customer picks up, no bot. | | `state` | `DeliveryState` | yes | | | `paused` | `boolean` | yes | True while on hold. `state` keeps the leg it was on. | | `bot` | `object \| null` | yes | The assigned bot. Null before assignment and for pickup-only. | | `bot.id` | `string` | yes | | | `bot.lat` | `number \| null` | yes | | | `bot.lng` | `number \| null` | yes | | | `bot.door_status` | `string \| null` | yes | | | `bot.control` | `object \| null` | yes | Who drives the bot. Set on webhooks only; null on reads. | | `bot.control.mode` | `'autonomous' \| 'teleop_requested' \| 'teleop'` | yes | `autonomous`: drives itself. `teleop_requested`: waiting for an operator. `teleop`: an operator is driving. | | `bot.control.since` | `number \| null` | yes | Epoch milliseconds when the mode started. Null when autonomous. | | `location_id` | `string` | yes | | | `arriving` | `boolean \| null` | yes | True while the bot approaches its current stop. Not the signal to load: wait for `at_pickup`. | | `arriving_at` | `string (date-time) \| null` | yes | Estimated arrival at the current stop. | | `options` | `object` | yes | Stored options. `tracking` is not returned. | | `options.bots` | `string[] \| null` | yes | | | `options.bot_tags` | `string[] \| null` | yes | | | `options.require_available_bot` | `boolean` | yes | | | `options.webhook_url` | `string \| null` | yes | | | `options.webhook_headers` | `Record \| null` | yes | | | `options.return_enabled` | `boolean` | yes | | | `options.eta_updates` | `boolean` | yes | | | `external_id` | `string \| null` | yes | | | `pickup` | `DeliveryPoint` | yes | | | `dropoff` | `DeliveryPoint \| null` | yes | Null for pickup-only. | | `return_point` | `DeliveryPoint \| null` | yes | | | `packages` | `DeliveryPackage[]` | yes | | | `deliver_by` | `string (date-time) \| null` | yes | | | `created_at` | `string (date-time)` | yes | | | `metadata` | `Record \| null` | yes | | | `event_type` | `string \| null` | yes | On a webhook, the event that sent it. Null on reads. | | `estimates` | `object` | yes | | | `estimates.distance` | `number \| null` | yes | Meters left. | | `estimates.duration` | `number \| null` | yes | Milliseconds of travel left. | | `estimates.pickup` | `DeliveryNodeEstimate` | yes | | | `estimates.dropoff` | `DeliveryNodeEstimate \| null` | yes | | | `estimates.scheduled_at` | `string (date-time) \| null` | yes | | | `estimates.target_completion_at` | `string (date-time) \| null` | yes | | | `tracker_url` | `string \| null` | yes | Tracking page for the recipient. | | `scheduled` | `boolean` | yes | | | `cancellation_reason` | `string \| null` | yes | | | `incomplete_reason` | `string \| null` | yes | | ### DeliveryState Where the delivery is. Standard: `pending` → `going_to_pickup` → `at_pickup` → `going_to_dropoff` → `at_dropoff` → `delivered`, or `going_to_return` → `at_return` → `returned`. Pickup-only: `pending` → `preparing` → `ready_for_pickup` → `picked_up`. `canceled` means someone called it off; `failed` means it could not be completed. ### DeliveryPoint | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string \| null` | yes | Registered point id, or null when the point was sent as coordinates only. | | `name` | `string` | yes | | | `lat` | `number` | yes | | | `lng` | `number` | yes | | | `azimuth` | `number \| null` | yes | Approach heading in degrees, 0 to 360. | | `contact` | `object \| null` | yes | | | `contact.name` | `string \| null` | yes | | | `contact.phone` | `string \| null` | yes | | | `contact.email` | `string \| null` | yes | | | `matching` | `{ mode: 'exact', required?: boolean } \| { mode: 'snap', radius: number, required?: boolean } \| { mode: 'associate', radius: number, required?: boolean } \| null` | yes | Link coordinates to a registered point. `exact`: a point within 5 m, use its coordinates. `snap`: the nearest point within `radius` meters, use its coordinates. `associate`: the nearest point within `radius` meters, keep your coordinates. `required: true` fails with 400 when none is found. | ### DeliveryPackage | Field | Type | Required | Description | | --- | --- | --- | --- | | `reference` | `string \| null` | yes | Your reference, as sent. | | `items` | `({ name: string, quantity: number, description: string \| null, picture_url: string \| null, metadata: Record \| null })[] \| null` | yes | | | `items[].name` | `string` | yes | | | `items[].quantity` | `number` | yes | | | `items[].description` | `string \| null` | yes | | | `items[].picture_url` | `string \| null` | yes | | | `items[].metadata` | `Record \| null` | yes | | | `dimensions` | `object \| null` | yes | Always null today: dimensions are accepted on create but not stored. | | `dimensions.length` | `number \| null` | yes | | | `dimensions.width` | `number \| null` | yes | | | `dimensions.height` | `number \| null` | yes | | | `weight` | `number \| null` | yes | Grams. | | `metadata` | `Record \| null` | yes | | | `station` | `string \| null` | yes | Prep station, trimmed. Send this value back to target the station. | | `loaded` | `boolean` | yes | True once this package's pickup load is complete. | ### DeliveryNodeEstimate | Field | Type | Required | Description | | --- | --- | --- | --- | | `arrival_at` | `string (date-time) \| null` | yes | The real arrival once reached, else a projection. Null when unknown. | | `completion_at` | `string (date-time) \| null` | yes | When the stop finishes: real once done, else a projection. | | `source` | `'actual' \| 'derived' \| null` | yes | `actual`: `arrival_at` already happened. `derived`: a projection. | | `unknown_reason` | `'no_route' \| 'unpriced_leg' \| 'not_departed' \| null` | yes | Set whenever `arrival_at` is null. `no_route`: no bot yet. `unpriced_leg`: leg not priced yet. `not_departed`: not on its way yet. | ### DeliveryEta | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string \| null` | yes | The bot the estimate is for. Null until a bot is assigned. | | `pickup_eta` | `string (date-time) \| null` | yes | | | `dropoff_eta` | `string (date-time) \| null` | yes | | ### DeliveryRoute | Field | Type | Required | Description | | --- | --- | --- | --- | | `source` | `'estimated' \| 'robot'` | yes | Always `estimated` today. Handle other values. | | `mapped` | `boolean` | yes | False when at least one leg is a straight-line estimate. | | `computed_at` | `string (date-time)` | yes | | | `position_recorded_at` | `string (date-time) \| null` | yes | When the bot reported the start position. Null before a bot drives it. | | `distance` | `number` | yes | Meters left, travel only. | | `duration` | `number` | yes | Milliseconds left, travel only. | | `points` | `[number, number][]` | yes | `[lat, lng]` pairs in driving order. Empty at the last stop. | | `stops` | `({ name: 'pickup' \| 'dropoff' \| 'return', lat: number, lng: number, point_index: number })[]` | yes | | | `stops[].name` | `'pickup' \| 'dropoff' \| 'return'` | yes | | | `stops[].lat` | `number` | yes | | | `stops[].lng` | `number` | yes | | | `stops[].point_index` | `number` | yes | Index into `points` of this stop. | ### PointAvailability | Field | Type | Required | Description | | --- | --- | --- | --- | | `available` | `boolean` | yes | | | `last_seen_at` | `string` | no | Present only when available. | | `reason` | `enum` | yes | One of `ok`, `no_session`, `no_kds_session`, `not_engine_mode`, `reporting_disabled`, `not_pickup`, `unknown_point`. | | `pds` | `object` | no | Kitchen-display locations only: the operator tablet. | | `pds.available` | `boolean` | yes | | | `pds.last_seen_at` | `string` | no | | | `kds` | `object` | no | Kitchen-display locations only: the kitchen board. | | `kds.available` | `boolean` | yes | | | `kds.last_seen_at` | `string` | no | | | `point_id` | `string \| null` | yes | | | `external_id` | `string \| null` | yes | | | `name` | `string \| null` | yes | | ### Availability | Field | Type | Required | Description | | --- | --- | --- | --- | | `available` | `boolean` | yes | | | `last_seen_at` | `string` | no | Present only when available. | | `reason` | `enum` | yes | One of `ok`, `no_session`, `no_kds_session`, `not_engine_mode`, `reporting_disabled`, `not_pickup`, `unknown_point`. | | `pds` | `object` | no | Kitchen-display locations only: the operator tablet. | | `pds.available` | `boolean` | yes | | | `pds.last_seen_at` | `string` | no | | | `kds` | `object` | no | Kitchen-display locations only: the kitchen board. | | `kds.available` | `boolean` | yes | | | `kds.last_seen_at` | `string` | no | | ### PointInput | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | no | A registered point. | | `external_id` | `string` | no | A registered point, by your id. | | `name` | `string` | no | | | `lat` | `number` | no | | | `lng` | `number` | no | | | `azimuth` | `integer \| null` | no | Approach heading in degrees. 0 to 360. | | `contact` | `object \| null` | no | Contact at this point. On the dropoff, the recipient of tracking messages. | | `contact.name` | `string \| null` | no | | | `contact.phone` | `string \| null` | no | With country code. Needed for SMS tracking. | | `contact.email` | `string (email) \| null` | no | Needed for email tracking. | | `matching` | `{ mode: 'exact', required?: boolean } \| { mode: 'snap', radius: number, required?: boolean } \| { mode: 'associate', radius: number, required?: boolean } \| null` | no | Link coordinates to a registered point. `exact`: a point within 5 m, use its coordinates. `snap`: the nearest point within `radius` meters, use its coordinates. `associate`: the nearest point within `radius` meters, keep your coordinates. `required: true` fails with 400 when none is found. | ### PackageInput | Field | Type | Required | Description | | --- | --- | --- | --- | | `description` | `string \| null` | no | | | `picture_url` | `string \| null` | no | | | `reference` | `string \| null` | no | Your reference. Target this package by it when loading. | | `items` | `({ name: string, quantity: integer, description?: string \| null, picture_url?: string (uri) \| null, metadata?: Record \| null })[] \| null` | no | | | `items[].name` | `string` | yes | | | `items[].quantity` | `integer` | yes | At most 9007199254740991. | | `items[].description` | `string \| null` | no | | | `items[].picture_url` | `string (uri) \| null` | no | | | `items[].metadata` | `Record \| null` | no | | | `dimensions` | `object \| null` | no | | | `dimensions.length` | `number` | yes | Length in millimeters | | `dimensions.width` | `number` | yes | Width in millimeters | | `dimensions.height` | `number` | yes | Height in millimeters | | `weight` | `number \| null` | no | Grams. | | `metadata` | `Record \| null` | no | | | `station` | `string \| null` | no | Prep station that owns this package (e.g. "Burger Shop"). Create one package per station to enable the PDS station filter. Trimmed; blank is treated as no station; max 50 characters. | ### DeliveryOptionsInput | Field | Type | Required | Description | | --- | --- | --- | --- | | `bots` | `string[] \| null` | no | Pin the delivery to one bot id. | | `bot_tags` | `string[]` | no | Only bots carrying every tag can take it. Up to 20 items. | | `require_available_bot` | `boolean \| null` | no | Fail with 409 `NO_AVAILABLE_BOT` instead of waiting when no bot is free. Not with `deliver_by`. | | `webhook_url` | `string (uri) \| null` | no | Where this delivery's webhooks go. No URL, no webhooks. | | `webhook_headers` | `Record \| null` | no | Sent with every webhook, for example your auth header. | | `return_enabled` | `boolean \| null` | no | If canceled after loading, the bot brings the order back to `return_point`, else to the pickup. | | `eta_updates` | `boolean \| null` | no | Also send a `node_eta_changed` webhook when an arrival time moves. | | `tracking` | `object \| null` | no | Text or email the recipient at each step. Needs the matching contact detail. | | `tracking.notify` | `object \| null` | no | | | `tracking.notify.sms` | `boolean \| null` | no | | | `tracking.notify.email` | `boolean \| null` | no | | ### Partner | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | | | `external_id` | `string` | yes | Assigned by REMI, starting with `ext_`. You cannot set it. | | `namespace` | `string` | yes | Taken from your API key. | | `name` | `string` | yes | | | `enabled` | `boolean` | yes | | ### PartnerResponse | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Partner` | yes | | ### Location | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | | | `external_id` | `string` | yes | Assigned by REMI, starting with `ext_`. You cannot set it. | | `partner_id` | `string \| null` | yes | | | `full_name` | `string` | yes | | | `short_name` | `string` | yes | | | `country_code` | `string` | yes | | | `city_name` | `string \| null` | yes | | | `state_name` | `string \| null` | yes | | | `time_zone` | `string \| null` | yes | | | `enabled` | `boolean` | yes | | | `polygon` | `object` | yes | Operating area. `coordinates` is a flat list of `[lng, lat]` pairs, not the nested rings of standard GeoJSON. | | `polygon.type` | `'Polygon'` | yes | | | `polygon.coordinates` | `number[][]` | yes | | | `availability_intervals` | `Record \| null` | yes | Opening hours, set by REMI. Null when none are configured. | ### LocationResponse | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Location` | yes | | ### LocationPaths | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | `'FeatureCollection'` | yes | | | `features` | `({ type: 'Feature', geometry: { type: 'LineString', coordinates: [number, number][] }, properties: { id: number \| null, kind: 'sidewalk' \| 'crossing' \| 'driveway' } })[]` | yes | | | `features[].type` | `'Feature'` | yes | | | `features[].geometry` | `object` | yes | | | `features[].geometry.type` | `'LineString'` | yes | | | `features[].geometry.coordinates` | `[number, number][]` | yes | `[lng, lat]` pairs in drive order. | | `features[].properties` | `object` | yes | | | `features[].properties.id` | `number \| null` | yes | Id of the way in our map. Null when the map has none. | | `features[].properties.kind` | `'sidewalk' \| 'crossing' \| 'driveway'` | yes | | ### Point | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | | | `external_id` | `string` | yes | Your `external_id`, or `ext_` followed by 21 characters when you did not set one. | | `location_id` | `string` | yes | | | `partner_id` | `string \| null` | yes | | | `name` | `string` | yes | | | `description` | `string \| null` | yes | | | `lat` | `number` | yes | | | `lng` | `number` | yes | | | `azimuth` | `number \| null` | yes | Approach heading in degrees, 0 to 360. | | `tags` | `('pickup' \| 'dropoff')[]` | yes | Roles of the point, the same values `PATCH` accepts. REMI may set other roles that are not shown. | ### PointResponse | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Point` | yes | | ### Bot | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | | | `commercial_name` | `string \| null` | yes | | | `available` | `boolean` | yes | In service. Stays true during a delivery: use `can_take_delivery` to know whether the bot is free. | | `can_take_delivery` | `boolean` | yes | True when the bot is in service, connected, and free or only on work that a new delivery replaces. | | `availability_status` | `enum \| null` | yes | One of `available`, `marketing`, `maintenance`, `mapping`, `off_duty`, `unknown`. | | `connected` | `boolean` | yes | True while the bot is online. | | `operational` | `boolean` | yes | | | `autonomy_enabled` | `boolean` | yes | | | `manual_close_door` | `boolean` | yes | | | `location_id` | `string \| null` | yes | | | `partner_id` | `string \| null` | yes | | | `current_action` | `enum \| null` | yes | Deprecated. Always null. One of `move`, `load`, `activity`, `unload`, `finish`, `panic`. | | `current_job_id` | `string \| null` | yes | The delivery the bot is serving. Null while it is free or only on work that a new delivery replaces. | | `reserved_job_id` | `string \| null` | yes | | | `current_target_point_id` | `string \| null` | yes | Deprecated. Always null. | | `last_connection_event_at` | `number \| null` | yes | Epoch milliseconds. | | `last_operational_event_at` | `number \| null` | yes | Epoch milliseconds. | ### BotDetail | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | | | `commercial_name` | `string \| null` | yes | | | `available` | `boolean` | yes | In service. Stays true during a delivery: use `can_take_delivery` to know whether the bot is free. | | `can_take_delivery` | `boolean` | yes | True when the bot is in service, connected, and free or only on work that a new delivery replaces. | | `availability_status` | `enum \| null` | yes | One of `available`, `marketing`, `maintenance`, `mapping`, `off_duty`, `unknown`. | | `connected` | `boolean` | yes | True while the bot is online. | | `operational` | `boolean` | yes | | | `autonomy_enabled` | `boolean` | yes | | | `manual_close_door` | `boolean` | yes | | | `location_id` | `string \| null` | yes | | | `partner_id` | `string \| null` | yes | | | `current_action` | `enum \| null` | yes | Deprecated. Always null. One of `move`, `load`, `activity`, `unload`, `finish`, `panic`. | | `current_job_id` | `string \| null` | yes | The delivery the bot is serving. Null while it is free or only on work that a new delivery replaces. | | `reserved_job_id` | `string \| null` | yes | | | `current_target_point_id` | `string \| null` | yes | Deprecated. Always null. | | `last_connection_event_at` | `number \| null` | yes | Epoch milliseconds. | | `last_operational_event_at` | `number \| null` | yes | Epoch milliseconds. | | `telemetry` | `BotTelemetry` | yes | The last values the robot reported. A group is null when it has not reported it. | | `control` | `BotControl \| null` | yes | Who drives the bot. Null when it could not be read: retry. | ### BotTelemetry | Field | Type | Required | Description | | --- | --- | --- | --- | | `position` | `object \| null` | yes | | | `position.lat` | `number` | yes | | | `position.lng` | `number` | yes | | | `position.heading` | `number \| null` | yes | Compass bearing in degrees: 0 is north, 90 is east. Null when the robot reports none. | | `position.recorded_at` | `string (date-time)` | yes | When the robot measured it, in UTC. | | `battery` | `object \| null` | yes | | | `battery.percentage` | `number` | yes | | | `battery.charging` | `boolean \| null` | yes | True while the battery takes current (pad or cable) or a full bot rests on the pad. Null when the robot reports no battery current. | | `battery.recorded_at` | `string (date-time)` | yes | When the robot measured it, in UTC. | | `speed` | `object \| null` | yes | Null while the bot is offline. | | `speed.mps` | `number` | yes | Meters per second, never negative. | | `speed.recorded_at` | `string (date-time)` | yes | When the robot measured it, in UTC. | | `door` | `object \| null` | yes | | | `door.status` | `'opened' \| 'closed' \| 'opening' \| 'closing' \| 'stalled'` | yes | | | `door.recorded_at` | `string (date-time)` | yes | When the robot measured it, in UTC. | ### BotControl | Field | Type | Required | Description | | --- | --- | --- | --- | | `mode` | `'autonomous' \| 'teleop_requested' \| 'teleop'` | yes | `autonomous`: drives itself. `teleop_requested`: waiting for an operator. `teleop`: an operator is driving. | | `since` | `number \| null` | yes | Epoch milliseconds when the mode started. Null when autonomous. | --- # Fleet integrations > Connect your own robots so REMI can dispatch deliveries to them. Connect your robots and REMI dispatches deliveries to them. You keep running your robots; REMI decides where they go, sends the commands, and follows each bot through the state you report. ```steps register: Register your bots report: Report their state command: REMI sends commands confirm: You confirm in the state deliver: The delivery moves on ``` ## How it works 1. Robot.com sets up your fleet and gives you an API key with the `fleet` scope. See [Onboarding](https://docs.remi.robot.com/fleets/onboarding). 2. You [register each bot](https://docs.remi.robot.com/fleets/reference#registerBot) and [declare what it can do](https://docs.remi.robot.com/fleets/reference#setFleetCapabilities). 3. You report each bot's [state](https://docs.remi.robot.com/fleets/state): position, battery, door, and the command it is running. 4. REMI sends [commands](https://docs.remi.robot.com/fleets/commands): `navigate_to`, `cancel_navigation` and `set_door`. You confirm each one through the state. ## Pick a transport Both carry the same messages. Choose one with `transport` in [`PATCH /fleet`](https://docs.remi.robot.com/fleets/reference#updateFleetConfig). | | HTTP | MQTT | | --- | --- | --- | | State | REMI polls your `GET /bots`, or you push to `POST /fleet/state` | You publish on `fleet/{namespace}/bot/{bot_id}/state` | | Commands | REMI calls your `POST /bots/{bot_id}/commands` | You subscribe to `fleet/{namespace}/bot/{bot_id}/command` | | Connected | From the polls | From each bot's broker connection | Details: [MQTT mode](https://docs.remi.robot.com/fleets/mqtt). ## Two APIs - [Fleet API](https://docs.remi.robot.com/fleets/reference): what you call on REMI, to configure the fleet, register bots, and push state and events. - [Partner API](https://docs.remi.robot.com/fleets/partner-api): what you serve in HTTP mode, and REMI calls. Start from the [integration kit](https://docs.remi.robot.com/fleets/kit): a working adapter and simulator. --- # Onboarding > What we set up for you, and the checks before going live. ## What Robot.com sets up - Your partner and its namespace, like `partner_acme`. Every bot id starts with your fleet's bot id prefix. - The fleet configuration, with its poll intervals. - A sandbox location with a pickup, a dropoff and a return point, to test deliveries. - Your first bots, registered and placed in the sandbox. - One API key, with the `fleet` and `delivery` scopes. - For MQTT: a broker address and one username and password for your fleet. You receive these as a `.env` file for the [integration kit](https://docs.remi.robot.com/fleets/kit). ## What you do 1. Choose a transport with [`PATCH /fleet`](https://docs.remi.robot.com/fleets/reference#updateFleetConfig). For HTTP, send your `base_url` and the token REMI must send you (at least 32 characters). 2. [Declare capabilities](https://docs.remi.robot.com/fleets/reference#setFleetCapabilities): which commands your bots support and whether they have a door. 3. Add more bots with [`POST /fleet/bots`](https://docs.remi.robot.com/fleets/reference#registerBot) when you need them. A new bot has no location until Robot.com operations places it, and gets no work before. 4. Report state, and handle commands. Check what REMI sees with [`GET /fleet`](https://docs.remi.robot.com/fleets/reference#getFleetConfig) and [`GET /fleet/bots`](https://docs.remi.robot.com/fleets/reference#listBots): `blocked_by` says why a bot is not getting work. 5. Run test deliveries in the sandbox with the [Delivery API](https://docs.remi.robot.com/delivery). ## Before going live In HTTP mode, Robot.com runs a conformance check against your endpoints: valid states from `GET /bots`, a `202` with a valid body for each command, the same answer for a repeated command id, and the error codes for an unknown bot or command. --- # Report bot state > Tell REMI where each bot is and what it is doing. REMI knows your bots only through the state you report. A state is complete: every field, every time. ```json { "bot_id": "ACME-4T001", "seq": 88214, "timestamp": "2026-06-17T15:48:08.000Z", "available": true, "connected": true, "position": { "lat": 4.6498, "lng": -74.0712, "azimuth": 90.3 }, "battery": { "percentage": 74 }, "motion": { "speed_mps": 0 }, "door": "closed", "current_command": { "id": "ES-5867/pickup", "state": "succeeded", "accepted_at": "2026-06-17T15:46:31.220Z", "updated_at": "2026-06-17T15:48:05.400Z" } } ``` All fields: [BotState](https://docs.remi.robot.com/fleets/partner-api#type-BotState). ## The fields that matter most - `timestamp` is when you measured it, not when you sent it. With `seq`, it decides which state is newer: an older one is discarded. - `available` is your verdict: can the bot take new work now? Do not fold connectivity into it. - `door`: send `unknown` when you cannot read it and `unsupported` when there is no door. Never `closed` by default. - `current_command` is the latest command the bot accepted. REMI counts a command as received when its `id` appears here, and follows it to `succeeded`, `failed` or `rejected`. - Report `position` and `motion.speed_mps` all the time: REMI also sees arrival from the bot stopping at the destination. ## How REMI gets it | Transport | How | | --- | --- | | HTTP, polled | REMI calls your [`GET /bots`](https://docs.remi.robot.com/fleets/partner-api#listPartnerBots) and expects every bot, within 5 seconds. | | HTTP, pushed | You call [`POST /fleet/state`](https://docs.remi.robot.com/fleets/reference#pushBotState), up to 200 states at once. While pushes arrive, REMI does not poll. | | MQTT | You publish on `fleet/{namespace}/bot/{bot_id}/state`, retained. See [MQTT mode](https://docs.remi.robot.com/fleets/mqtt). | ## Connected and disconnected Over HTTP, a bot is disconnected after 3 failed or missing polls in a row, or when its state is 60 seconds old. It reconnects after 2 good polls in a row. Over MQTT, the bot's broker connection decides. ## Events [`POST /fleet/events`](https://docs.remi.robot.com/fleets/reference#reportBotEvent) is optional: `arrived` lets REMI react the moment a bot stops, and `blocked` opens a task for an operator until you send `unblocked`. --- # Handle commands > Receive navigation and door commands and confirm them. REMI sends one command to one bot at a time. You accept it at once, and report its progress in the bot's state. | Command | Does | Required | | --- | --- | --- | | `navigate_to` | Drive to `lat`, `lng`. | Yes | | `cancel_navigation` | Stop the current navigation. | Yes | | `set_door` | Open or close the cargo door. | No | All fields: [BotCommand](https://docs.remi.robot.com/fleets/partner-api#type-BotCommand). ## Accept, then report 1. REMI calls [`POST /bots/{bot_id}/commands`](https://docs.remi.robot.com/fleets/partner-api#createBotCommand) (or publishes it over MQTT). 2. Answer `202` with a [CommandStatus](https://docs.remi.robot.com/fleets/partner-api#type-CommandStatus) in state `accepted`, as soon as it is queued. Do not wait for the bot. 3. Report its progress in `current_command` of the bot's state: `executing`, then `succeeded` or `failed`. ```steps accepted: Queued executing: In progress succeeded: Done ``` ## Rules - **Idempotent on `(bot_id, id)`.** An unconfirmed command is sent again with the same `id` every 10 seconds, 3 times in total. Answer a repeat exactly as the first one. - **Only `202` with a valid body counts.** Any other `2xx`, or a bad body, is treated as not received. - **Reject with a reason.** Answer `404 BOT_NOT_FOUND`, `409 BOT_BUSY`, `409 COMMAND_EXPIRED`, `422 UNSUPPORTED_COMMAND` or `422 DESTINATION_UNREACHABLE`, or report `state: rejected`. A rejection is final. - **A failed navigation is retried.** After `failed`, REMI sends `navigate_to` again under a new id (`~1`, `~2`), up to 5 times. - **Interrupting.** If you declared `supports_command_interrupt: true`, a new `navigate_to` replaces the current one. Otherwise REMI sends `cancel_navigation` first and waits. - **Doors.** `set_door` never goes to a bot with `has_door: false`, and `closed` never to one with `manual_close_door: true`. ## Moved destinations If a destination is off your network, you may move it: report `corrected_position` and `correction_distance_m` while the command runs. REMI expects the bot to stop there. If you cannot reach it at all, reject with `DESTINATION_UNREACHABLE`. --- # MQTT mode > The same contract over MQTT instead of HTTP. MQTT mode carries the same [state](https://docs.remi.robot.com/fleets/state), [commands](https://docs.remi.robot.com/fleets/commands) and events as HTTP, over a broker Robot.com runs. Select it with `transport: "mqtt"` in [`PATCH /fleet`](https://docs.remi.robot.com/fleets/reference#updateFleetConfig). ## Topics | Topic | You | Payload | Notes | | --- | --- | --- | --- | | `fleet/{namespace}/bot/{bot_id}/state` | Publish | [BotState](https://docs.remi.robot.com/fleets/partner-api#type-BotState) | QoS 1, retained. Publish whenever something meaningful changes. | | `fleet/{namespace}/bot/{bot_id}/event` | Publish | [BotEvent](https://docs.remi.robot.com/fleets/partner-api#type-BotEvent) | QoS 1, not retained. Optional. | | `fleet/{namespace}/bot/{bot_id}/command` | Subscribe | [BotCommand](https://docs.remi.robot.com/fleets/partner-api#type-BotCommand) | REMI publishes at QoS 2, not retained. | ## Connections - Open one connection per bot, with client id `fleet-{namespace}-{bot_id}-hb`. REMI takes `connected` from that connection, not from the payload. - Username `fleet_{namespace}`, with the password and broker address you get at onboarding. ## Commands without a reply There is no answer to a command message. Confirm it by putting its `id` in `current_command` of the bot's next state, or reject it there with `state: rejected`. An unconfirmed command is published again with the same `id` every 10 seconds, 3 times in total. --- # Integration kit > A reference adapter and simulator to start from. The [external-fleet-kit](https://github.com/gokiwibot/external-fleet-kit) is an open-source fleet adapter that implements this whole contract: it reports state, takes commands, confirms them in `current_command` and reports arrivals. It ships with simulated robots, so you can watch a delivery run end to end before writing any code. ## Run it You need the `.env` Robot.com sends you at [onboarding](https://docs.remi.robot.com/fleets/onboarding). ```bash git clone https://github.com/gokiwibot/external-fleet-kit && cd external-fleet-kit pnpm install cp /path/to/the/.env/you/received .env pnpm efk check pnpm efk start ``` | Command | Does | | --- | --- | | `efk check` | Checks your key, fleet, bots, sandbox and broker. Read-only. | | `efk start` | Connects your bots and shows a dashboard. | | `efk order create` | Creates a test delivery in your sandbox, to watch one of your bots take it. | ## The sandbox Your sandbox is a location of your own, with test points and your bots already placed in it. Orders you create there go to your own bots, through the same dispatch as production. Nothing real is delivered. ## From the simulator to your robots Your robots plug in through one interface, `RobotDriver`: where the robot is, its battery and door, and how it navigates, cancels and opens. Implement it against your own robot API and run `efk check` again. Everything between REMI and the driver stays the kit's. The kit's README walks through each method. ## When a bot gets no work [`GET /fleet/bots`](https://docs.remi.robot.com/fleets/reference#listBots) shows each bot as REMI sees it. `blocked_by` names the reason, like `disconnected` or `no_location`. --- # Fleet API reference > The endpoints your fleet calls on REMI. Register your robots with REMI, report their state and events, and declare what they can do. - Base URL: `https://api.remi.robot.com/api/v3` - Auth: An API key with the `fleet` scope, sent as `Authorization: Bearer `. Ask your Robot.com representative for one. - OpenAPI document: https://docs.remi.robot.com/openapi/fleet.json ## Fleet How your fleet is wired into REMI. ### Get fleet configuration `GET /fleet` (scope `fleet`) How your fleet is wired into REMI. Read it to confirm what REMI believes before you debug anything else. Response 200: The configuration. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetConfig` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | Example response: ```json { "data": { "namespace": "partner_acme", "bot_id_prefix": "ACME-", "requires_fleet_serial": false, "transport": "http", "base_url": "https://fleet.example.com/v1", "token_set": true, "poll_interval_active_ms": 2000, "poll_interval_idle_ms": 15000, "max_bots": 200, "contract_version": "2026-09", "capabilities": { "supports_command_interrupt": true, "default": { "has_door": true, "supported_commands": [ "navigate_to", "cancel_navigation", "set_door" ] }, "overrides": { "ACME-4T002": { "has_door": false, "supported_commands": [ "navigate_to", "cancel_navigation" ] } } } } } ``` ### Configure the fleet `PATCH /fleet` (scope `fleet`) The first call creates the configuration; later calls change only the fields sent. - `transport: "http"` needs a `base_url` and a token on file. - Changing `base_url` needs a new `token` in the same call. A stored token is never carried to a new endpoint. - Poll intervals, bot id prefix and namespace are set at onboarding and cannot be changed here. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `transport` | `'mqtt' \| 'http'` | no | How state and commands travel. `http`: REMI polls your `GET /bots` unless you push. `mqtt`: the MQTT topics. | | `base_url` | `string` | no | Required for `http`. An absolute `https` URL. REMI appends the Partner API paths to it. | | `token` | `string` | no | Required for `http`. A secret of your choosing, at least 32 characters, sent as `Authorization: Bearer ` on every call to you. Never returned. | Response 200: The configuration after the change. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetConfig` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `VALIDATION_ERROR` | Empty body, unknown field, or a value of the wrong type. | | 400 | `INVALID_BASE_URL` | `base_url` is not an absolute `https` URL. | | 400 | `TOKEN_TOO_SHORT` | `token` has fewer than 32 characters. | | 400 | `TOKEN_REQUIRED_WITH_BASE_URL` | `base_url` changes and no new `token` was sent. | | 400 | `INCOMPLETE_HTTP_CONFIG` | `transport` is `http` and there is no `base_url` or no token on file. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 409 | `NAMESPACE_NOT_MQTT_SAFE` | Your namespace is not `[a-z0-9_]+`. Ask Robot.com to change it first. | Example request: ```json { "transport": "http", "base_url": "https://fleet.example.com/v1", "token": "k3VnQ8xLw2ZpR7tYb5MdC9sHf1GjA4uE" } ``` Example response: ```json { "data": { "namespace": "partner_acme", "bot_id_prefix": "ACME-", "requires_fleet_serial": false, "transport": "http", "base_url": "https://fleet.example.com/v1", "token_set": true, "poll_interval_active_ms": 2000, "poll_interval_idle_ms": 15000, "max_bots": 200, "contract_version": "2026-09", "capabilities": { "supports_command_interrupt": true, "default": { "has_door": true, "supported_commands": [ "navigate_to", "cancel_navigation", "set_door" ] }, "overrides": { "ACME-4T002": { "has_door": false, "supported_commands": [ "navigate_to", "cancel_navigation" ] } } } } } ``` ## Capabilities What your robots can do. ### Set fleet capabilities `POST /fleet/capabilities` (scope `fleet`) Replaces the whole document. The document is optional: without one, REMI sends `set_door` to every bot and treats `supports_command_interrupt` as false. - It describes your hardware, not who is connected. Never send it from an empty or partial roster. - A bot whose effective `has_door` is false gets no `set_door`, and its `manual_close_door` is turned on. REMI never turns it back off. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `supports_command_interrupt` | `boolean` | yes | Whether a `navigate_to` sent during another navigation is accepted and replaces it. Fleet-wide. Without a document this is false. | | `default` | `object` | yes | Applies to every bot unless overridden. | | `default.has_door` | `boolean` | yes | Whether the bot has a remotely controllable cargo door. False: `set_door` is never sent. | | `default.supported_commands` | `('navigate_to' \| 'cancel_navigation' \| 'set_door')[]` | yes | The command types this bot accepts. | | `overrides` | `Record` | no | Keyed by bot id and merged over `default`, field by field. Default `{}`. | Response 200: The stored document. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetCapabilities` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `VALIDATION_ERROR` | A required field is missing, or a command type is unknown. | | 400 | `CAPABILITIES_MISSING_REQUIRED_COMMANDS` | `default.supported_commands` lacks `navigate_to` or `cancel_navigation`. Nothing is stored. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | Example request: ```json { "supports_command_interrupt": true, "default": { "has_door": true, "supported_commands": [ "navigate_to", "cancel_navigation", "set_door" ] }, "overrides": { "ACME-4T002": { "has_door": false, "supported_commands": [ "navigate_to", "cancel_navigation" ] } } } ``` Example response: ```json { "data": { "supports_command_interrupt": true, "default": { "has_door": true, "supported_commands": [ "navigate_to", "cancel_navigation", "set_door" ] }, "overrides": { "ACME-4T002": { "has_door": false, "supported_commands": [ "navigate_to", "cancel_navigation" ] } } } } ``` ### Update fleet capabilities `PATCH /fleet/capabilities` (scope `fleet`) Merges into the stored document, which must exist: create it with `POST` first. `default` and `overrides` are replaced whole when sent, so to remove an override, send `overrides` without it. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `supports_command_interrupt` | `boolean` | no | | | `default` | `object` | no | | | `default.has_door` | `boolean` | yes | Whether the bot has a remotely controllable cargo door. False: `set_door` is never sent. | | `default.supported_commands` | `('navigate_to' \| 'cancel_navigation' \| 'set_door')[]` | yes | The command types this bot accepts. | | `overrides` | `Record` | no | | Response 200: The stored document after the merge. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetCapabilities` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `VALIDATION_ERROR` | Empty body, unknown field, or an invalid value. | | 400 | `CAPABILITIES_MISSING_REQUIRED_COMMANDS` | `default.supported_commands` lacks `navigate_to` or `cancel_navigation`. Nothing is stored. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | | 404 | `CAPABILITIES_NOT_SET` | No document on file yet. | Example request: ```json { "supports_command_interrupt": false } ``` Example response: ```json { "data": { "supports_command_interrupt": false, "default": { "has_door": true, "supported_commands": [ "navigate_to", "cancel_navigation", "set_door" ] }, "overrides": { "ACME-4T002": { "has_door": false, "supported_commands": [ "navigate_to", "cancel_navigation" ] } } } } ``` ## Bots Register, update, retire and list your robots. ### List bots `GET /fleet/bots` (scope `fleet`) What REMI sees of your fleet, to find out why a bot is not assigned. Ordered by `bot_id`, retired bots included (always with `retired` in `blocked_by`). Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Page size, 1 to 200. 1 to 200. Default `100`. | | `cursor` | `string` | no | `next_cursor` of the previous page. Only valid with the same `limit`. | Response 200: A page of bots. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetBotListItem[]` | yes | | | `next_cursor` | `string \| null` | yes | Pass it as `cursor` for the next page. Null on the last page. | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `VALIDATION_ERROR` | `limit` is not an integer from 1 to 200. | | 400 | `INVALID_CURSOR` | The cursor is malformed or was issued for a different `limit`. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | Example response: ```json { "data": [ { "bot_id": "ACME-4T001", "fleet_serial": "AC7F3K2", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "current_job_id": null, "assignable": true, "blocked_by": [], "state_age_ms": 1840 }, { "bot_id": "ACME-4T002", "fleet_serial": null, "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "current_job_id": "ES-5867", "assignable": false, "blocked_by": [ "battery_below_minimum" ], "state_age_ms": 2100 } ], "next_cursor": null } ``` ### Register a bot `POST /fleet/bots` (scope `fleet`) Call once per bot, when it enters service. The bot has no location until Robot.com operations places it, and is not assigned before. - An existing id is a conflict, not an overwrite: use `PATCH` to change a bot. - Registering a retired bot of yours again reactivates it, keeping its stored `fleet_serial` unless you send one. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | Your bot id prefix followed by `[A-Za-z0-9_.-]+`, at most 64 characters in total. | | `fleet_serial` | `string` | no | The id your own system uses for the robot, when it differs from `bot_id`. At most 128 characters. Up to 128 characters. | | `manual_close_door` | `boolean` | no | True when the door must be closed by hand: REMI never sends `set_door` closed to this bot. Defaults to false. | | `commercial_name` | `string` | no | Display name shown to operators. Defaults to `bot_id`. | | `console_url` | `string` | no | The robot's page in your own operator console. Operators open it from the bot's Console. | | `tags` | `string[]` | no | Operational tags, up to 32 of at most 64 characters. Unknown tags are created. Jobs with `options.bot_tags` only go to bots carrying every tag. On update, replaces the whole list. Up to 32 items. | Response 201: The registered bot. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetBot` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `INVALID_BODY` | A required field is missing, or a field has the wrong type or length. | | 400 | `BOT_ID_NOT_NAMESPACED` | `bot_id` does not start with your bot id prefix. | | 400 | `BOT_ID_NOT_MQTT_SAFE` | `bot_id` is not the prefix followed by `[A-Za-z0-9_.-]+`, or is longer than 64 characters. | | 400 | `FLEET_SERIAL_REQUIRED` | Your fleet has `requires_fleet_serial: true` and the bot would have no `fleet_serial`. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | | 409 | `BOT_ID_TAKEN` | The id exists and is not a retired bot of yours. | | 409 | `FLEET_SERIAL_TAKEN` | Another bot of yours in service already addresses that robot. Retire the other one first. | Example request: ```json { "bot_id": "ACME-4T001", "fleet_serial": "AC7F3K2", "manual_close_door": true, "commercial_name": "Acme 4T001", "console_url": "https://console.example.com/robots/4T001", "tags": [ "acme-fleet", "lockable-door" ] } ``` Example response: ```json { "data": { "bot_id": "ACME-4T001", "namespace": "partner_acme", "location_id": null, "fleet_serial": "AC7F3K2", "manual_close_door": true, "commercial_name": "Acme 4T001", "console_url": "https://console.example.com/robots/4T001", "tags": [ "acme-fleet", "lockable-door" ], "retired_at": null } } ``` ### Update a bot `PATCH /fleet/bots/{bot_id}` (scope `fleet`) Changes only the fields sent. `bot_id`, `namespace` and `location_id` cannot be changed. - `tags` replaces the whole list. - Changing `fleet_serial` is refused while the bot holds a job, and takes the bot off duty until an operator puts it back. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | The bot id you registered. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `fleet_serial` | `string \| null` | no | `null` removes the mapping. Refused while the bot holds a job. Up to 128 characters. | | `manual_close_door` | `boolean` | no | True when the door must be closed by hand. | | `commercial_name` | `string` | no | Display name shown to operators. | | `console_url` | `string \| null` | no | `null` removes it, and the bot's Console goes back to REMI's own. | | `tags` | `string[]` | no | Operational tags, up to 32 of at most 64 characters. Unknown tags are created. Jobs with `options.bot_tags` only go to bots carrying every tag. On update, replaces the whole list. Up to 32 items. | Response 200: The bot after the change. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `FleetBot` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `IMMUTABLE_FIELD` | The body contains `bot_id`, `namespace` or `location_id`. | | 400 | `INVALID_BODY` | A field has the wrong type or length, or is unknown. | | 400 | `FLEET_SERIAL_REQUIRED` | Your fleet has `requires_fleet_serial: true` and the bot would have no `fleet_serial`. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | | 404 | `BOT_NOT_FOUND` | Unknown bot, or one that belongs to another partner. | | 409 | `BOT_HOLDS_JOB` | `fleet_serial` changes while the bot holds a job. | | 409 | `FLEET_SERIAL_TAKEN` | Another bot of yours in service already addresses that robot. Retire the other one first. | Example request: ```json { "manual_close_door": false } ``` Example response: ```json { "data": { "bot_id": "ACME-4T001", "namespace": "partner_acme", "location_id": "7Nk2QhVpXrLmT4wZaBcDe", "fleet_serial": "AC7F3K2", "manual_close_door": false, "commercial_name": "Acme 4T001", "console_url": "https://console.example.com/robots/4T001", "tags": [ "acme-fleet", "lockable-door" ], "retired_at": null } } ``` ### Retire a bot `DELETE /fleet/bots/{bot_id}` (scope `fleet`) Takes the bot out of service: it is no longer assigned, and its state and events are refused. History is kept, and registering the same id again reactivates it. Retiring twice is safe. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | The bot id you registered. | Response 200: The retired bot. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.bot_id` | `string` | yes | | | `data.retired_at` | `string (date-time) \| null` | yes | When the bot was retired. | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | | 404 | `BOT_NOT_FOUND` | Unknown bot, or one that belongs to another partner. | | 409 | `BOT_HOLDS_JOB` | The bot is running a job. | Example response: ```json { "data": { "bot_id": "ACME-4T002", "retired_at": "2026-06-17T15:52:00.000Z" } } ``` ## State and events Push robot state and events instead of being polled or using MQTT. ### Push bot state `POST /fleet/state` (scope `fleet`) The push alternative to being polled. While pushes keep arriving, REMI does not poll your `GET /bots`; it polls again after 60 seconds without one. - Up to 200 states per request. One invalid state, or one bot that is unknown or retired, rejects the whole request. - A state not newer than the last accepted for its bot is discarded and counted in `rejected`. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `bots` | `BotState[]` | yes | Complete bot states, at most 200 per request. Up to 200 items. | Response 202: Counts of accepted and discarded states. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.accepted` | `number` | yes | States forwarded to REMI. | | `data.rejected` | `number` | yes | States discarded because a newer one was already accepted for that bot. | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `INVALID_STATE` | `bots` is not an array, or a state is missing a required field. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | | 404 | `BOT_NOT_FOUND` | A `bot_id` is not a registered bot of yours, or is retired. | | 413 | `PAYLOAD_TOO_LARGE` | More than 200 states. | Example request: ```json { "bots": [ { "bot_id": "ACME-4T001", "seq": 88215, "timestamp": "2026-06-17T15:48:08.000Z", "available": true, "connected": true, "position": { "lat": 4.6498, "lng": -74.0712, "azimuth": 90.3 }, "battery": { "percentage": 74 }, "motion": { "speed_mps": 1.4 }, "door": "closed", "current_command": { "id": "ES-5867/pickup", "state": "executing", "accepted_at": "2026-06-17T15:46:31.220Z", "updated_at": "2026-06-17T15:47:10.000Z" } } ] } ``` Example response: ```json { "data": { "accepted": 1, "rejected": 0 } } ``` ### Report a bot event `POST /fleet/events` (scope `fleet`) Events are optional and safe to resend. `arrived` lets REMI react the moment a bot stops instead of on the next poll; the job still advances from `current_command` in the state. `blocked` opens an operator task that stays open until `unblocked`. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `type` | `'arrived' \| 'blocked' \| 'unblocked'` | yes | `arrived`: a navigation finished. `blocked` and `unblocked` open and close an operator task. | | `command_id` | `string` | no | Required for `arrived`: the id of the navigation command that just completed. | | `occurred_at` | `string (date-time)` | yes | When it happened on your side, not when you sent it. | | `detail` | `Record` | no | For `blocked`: `{ "reason": string, "message": string }`. | Response 202: The event was accepted. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.accepted` | `true` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `INVALID_EVENT` | Unknown `type`, or `arrived` without `command_id`. | | 400 | `PARTNER_NOT_FOUND` | Your namespace has no partner record yet. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `fleet` scope. | | 404 | `FLEET_NOT_CONFIGURED` | No fleet configuration for your namespace yet. Create it with `PATCH /fleet`. | | 404 | `BOT_NOT_FOUND` | `bot_id` is not a registered bot of yours, or is retired. | Example request: ```json { "bot_id": "ACME-4T001", "type": "arrived", "command_id": "ES-5867/pickup", "occurred_at": "2026-06-17T15:51:07.000Z" } ``` Example response: ```json { "data": { "accepted": true } } ``` ## Types ### Problem | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | `string` | yes | Always `about:blank`. | | `title` | `string` | yes | The HTTP status text. | | `status` | `integer` | yes | -9007199254740991 to 9007199254740991. | | `detail` | `string` | yes | Human-readable. Do not parse it: branch on `code`. | | `instance` | `string` | yes | The request path. | | `code` | `string` | no | Stable machine-readable error code, when the error has one. | | `params` | `Record` | no | Values that explain the error, keyed by name. | ### FleetConfig | Field | Type | Required | Description | | --- | --- | --- | --- | | `namespace` | `string` | yes | Your partner namespace. Permanent. It is the segment in every MQTT topic and client id. | | `bot_id_prefix` | `string` | yes | Every bot id must start with it. Defaults to your namespace in uppercase plus a hyphen. | | `requires_fleet_serial` | `boolean` | yes | Whether every bot you register needs `fleet_serial`. Set by Robot.com, read-only. | | `transport` | `'mqtt' \| 'http'` | yes | | | `base_url` | `string \| null` | yes | Where REMI calls you in `http` mode. Null when none is set. | | `token_set` | `boolean` | yes | Whether a bearer token for calling you is on file. The token is never returned. | | `poll_interval_active_ms` | `number` | yes | How often REMI polls `GET /bots` while any of your bots holds a job. Set at onboarding. | | `poll_interval_idle_ms` | `number` | yes | How often REMI polls `GET /bots` while your fleet is idle. Set at onboarding. | | `max_bots` | `number` | yes | The fleet size agreed at onboarding. At most 200. | | `contract_version` | `string` | yes | The contract version your fleet was onboarded against. | | `capabilities` | `FleetCapabilities \| null` | yes | Null until you set a document. | ### FleetCapabilities | Field | Type | Required | Description | | --- | --- | --- | --- | | `supports_command_interrupt` | `boolean` | yes | Whether a `navigate_to` sent during another navigation is accepted and replaces it. Fleet-wide. Without a document this is false. | | `default` | `object` | yes | Applies to every bot unless overridden. | | `default.has_door` | `boolean` | yes | Whether the bot has a remotely controllable cargo door. False: `set_door` is never sent. | | `default.supported_commands` | `('navigate_to' \| 'cancel_navigation' \| 'set_door')[]` | yes | The command types this bot accepts. | | `overrides` | `Record` | yes | Keyed by bot id and merged over `default`, field by field. | ### FleetBot | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `namespace` | `string` | yes | | | `location_id` | `string \| null` | yes | The location the bot serves, set by Robot.com operations. Null until placed: a bot with no location is never assigned. | | `fleet_serial` | `string \| null` | yes | Null means the robot is `bot_id` minus your prefix. | | `manual_close_door` | `boolean` | yes | | | `commercial_name` | `string` | yes | | | `console_url` | `string \| null` | yes | | | `tags` | `string[]` | yes | | | `retired_at` | `string (date-time) \| null` | yes | When the bot was retired. Null while in service. | ### FleetBotListItem | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `fleet_serial` | `string \| null` | yes | | | `location_id` | `string \| null` | yes | Null until Robot.com operations places the bot. | | `current_job_id` | `string \| null` | yes | The job the bot holds, or null. | | `assignable` | `boolean` | yes | True when `blocked_by` is empty. | | `blocked_by` | `string[]` | yes | Every reason the bot is not assigned, in this order: `disconnected`, `unavailable`, `battery_below_minimum`, `no_position`, `no_location`, `state_stale`, `retired`. | | `state_age_ms` | `number \| null` | yes | Age of the latest state REMI holds. Null if none was received. Above 60000 the bot counts as stale. | ### SetCapabilitiesRequest | Field | Type | Required | Description | | --- | --- | --- | --- | | `supports_command_interrupt` | `boolean` | yes | Whether a `navigate_to` sent during another navigation is accepted and replaces it. Fleet-wide. Without a document this is false. | | `default` | `object` | yes | Applies to every bot unless overridden. | | `default.has_door` | `boolean` | yes | Whether the bot has a remotely controllable cargo door. False: `set_door` is never sent. | | `default.supported_commands` | `('navigate_to' \| 'cancel_navigation' \| 'set_door')[]` | yes | The command types this bot accepts. | | `overrides` | `Record` | no | Keyed by bot id and merged over `default`, field by field. Default `{}`. | ### PatchCapabilitiesRequest | Field | Type | Required | Description | | --- | --- | --- | --- | | `supports_command_interrupt` | `boolean` | no | | | `default` | `object` | no | | | `default.has_door` | `boolean` | yes | Whether the bot has a remotely controllable cargo door. False: `set_door` is never sent. | | `default.supported_commands` | `('navigate_to' \| 'cancel_navigation' \| 'set_door')[]` | yes | The command types this bot accepts. | | `overrides` | `Record` | no | | ### BotState | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `seq` | `integer` | no | Increasing per bot. A state is kept only if its `timestamp` is later than the last accepted one, or equal with a higher `seq`. Without it, states are not ordered. 0 to 9007199254740991. | | `timestamp` | `string (date-time)` | yes | When the state was measured on your side, not when it was sent. | | `available` | `boolean` | yes | Whether the bot can take new work right now, by your own verdict. Do not fold in connectivity, staleness or out of service. | | `out_of_service` | `boolean` | no | True when you took the bot out of service. Operators are alerted while it holds a job, and new `navigate_to` commands are held back. Absent means false. | | `connected` | `boolean` | yes | Whether you have a live link to the bot. In MQTT mode the broker connection decides instead. | | `position` | `object` | yes | | | `position.lat` | `number` | yes | Latitude in decimal degrees, WGS 84. -90 to 90. | | `position.lng` | `number` | yes | Longitude in decimal degrees, WGS 84. -180 to 180. | | `position.azimuth` | `number` | no | Compass bearing in degrees: 0 = North, clockwise, nominally [0, 360). | | `battery` | `object` | yes | | | `battery.percentage` | `integer` | yes | State of charge, 0 to 100. Below 20 the bot gets no new jobs. 0 to 100. | | `motion` | `object` | no | | | `motion.speed_mps` | `number` | yes | Ground speed in meters per second. | | `door` | `enum` | yes | Cargo door state. Send `unknown` when you cannot read it and `unsupported` when the bot has no controllable door, never `closed`. One of `opened`, `closed`, `opening`, `closing`, `stalled`, `unknown`, `unsupported`. | | `current_command` | `CommandStatus \| null` | yes | The latest command this bot accepted. REMI counts a command as delivered when its `id` appears here. Null if none yet. | ### CommandStatus | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | The command id REMI sent. | | `state` | `'accepted' \| 'executing' \| 'succeeded' \| 'failed' \| 'rejected'` | yes | `accepted`: queued. `executing`: in progress. `succeeded`, `failed` and `rejected` are terminal. `failed`: accepted but cannot finish. `rejected`: you will not take it, with `error.code` and `rejected_at`. | | `accepted_at` | `string (date-time)` | no | Required unless `state` is `rejected`. | | `rejected_at` | `string (date-time)` | no | Required when `state` is `rejected`, absent otherwise. | | `updated_at` | `string (date-time)` | no | When `state` last changed. | | `error` | `object` | no | Set when `state` is `failed` or `rejected`. On a rejection, `code` is one of the four rejection codes. | | `error.code` | `string` | yes | | | `error.message` | `string` | yes | | | `corrected_position` | `object` | no | Where the bot will really stop when you moved a `navigate_to` destination. Only while `accepted` or `executing`. | | `corrected_position.lat` | `number` | yes | Latitude in decimal degrees, WGS 84. -90 to 90. | | `corrected_position.lng` | `number` | yes | Longitude in decimal degrees, WGS 84. -180 to 180. | | `correction_distance_m` | `number` | no | Meters between the requested destination and `corrected_position`, or, on a `DESTINATION_UNREACHABLE` rejection, your network. | ### BotEvent | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `type` | `'arrived' \| 'blocked' \| 'unblocked'` | yes | `arrived`: a navigation finished. `blocked` and `unblocked` open and close an operator task. | | `command_id` | `string` | no | Required for `arrived`: the id of the navigation command that just completed. | | `occurred_at` | `string (date-time)` | yes | When it happened on your side, not when you sent it. | | `detail` | `Record` | no | For `blocked`: `{ "reason": string, "message": string }`. | --- # Partner API reference > The endpoints your fleet serves, and REMI calls. The HTTP API your fleet serves in HTTP mode. REMI calls it to read bot state and to send commands. - Base URL: `https://fleet.example.com` - Auth: REMI sends the token you set with `PATCH /fleet` as `Authorization: Bearer `. - OpenAPI document: https://docs.remi.robot.com/openapi/fleet-partner.json ## State REMI calls this to read your bots. ### List bots with state `GET /bots` REMI polls this while your transport is `http` and you are not pushing state. Return every bot on every call, complete, without pagination: a bot left out, or with an invalid state, counts as a failed sample for that bot. - Answer within 5 seconds and under 1 MiB. REMI never runs two polls at once: the interval (`poll_interval_active_ms` while any bot holds a job, `poll_interval_idle_ms` otherwise) starts when the previous answer ends. - A bot becomes disconnected after 3 failed or missing polls in a row, or when its state is 60 seconds old. It reconnects after 2 polls in a row with `connected: true` and a fresh `timestamp`. Response 200: Every bot of the fleet. | Field | Type | Required | Description | | --- | --- | --- | --- | | `bots` | `BotState[]` | yes | Complete bot states, as `BotState`. | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Reject a missing or wrong bearer token. REMI counts any non-2xx answer as a failed poll. | | 500 | | Any other non-2xx status, a timeout, or a body that is not `{ "bots": [...] }` counts as a failed poll for every bot. | Example response: ```json { "bots": [ { "bot_id": "ACME-4T001", "seq": 88214, "timestamp": "2026-06-17T15:48:08.000Z", "available": true, "connected": true, "position": { "lat": 4.6498, "lng": -74.0712, "azimuth": 90.3 }, "battery": { "percentage": 74 }, "motion": { "speed_mps": 0 }, "door": "closed", "current_command": { "id": "ES-5867/pickup", "state": "succeeded", "accepted_at": "2026-06-17T15:46:31.220Z", "updated_at": "2026-06-17T15:48:05.400Z" } }, { "bot_id": "ACME-4T002", "seq": 51002, "timestamp": "2026-06-17T15:48:08.000Z", "available": false, "connected": true, "position": { "lat": 4.6498, "lng": -74.0712, "azimuth": 90.3 }, "battery": { "percentage": 31 }, "motion": { "speed_mps": 1.4 }, "door": "closed", "current_command": { "id": "ES-5868/dropoff", "state": "executing", "accepted_at": "2026-06-17T15:47:55.000Z" } } ] } ``` ## Commands REMI calls this to give a bot an order. ### Accept a command `POST /bots/{bot_id}/commands` REMI gives one bot one command and expects 202 as soon as it is queued, not when the bot finishes. Progress comes back in `current_command` of the bot state. - Be idempotent on `(bot_id, id)`. An unconfirmed command is resent with the same `id` every 10 seconds, 3 sends in total. - Only 202 with a valid `CommandStatus` body counts as received. Any other 2xx, or an invalid body, is treated as not received and resent. - A 202 body with `state: rejected` ends the command. With `state: failed` (its mission already ended), REMI sends a `navigate_to` again under a new id, `~1`, `~2` and so on, at most 5 times. - A `navigate_to` during another navigation must replace it if you declared `supports_command_interrupt: true`. Otherwise REMI sends `cancel_navigation` first and waits for it. - `set_door` is never sent to a bot with `has_door: false`, and `closed` never to one with `manual_close_door: true`. - A corrected destination is information: REMI neither resends nor cancels, and expects the bot to drive to `corrected_position`. Report `position` and `motion` so REMI can see the bot stop within 25 m of it. Answer a 4xx with a problem body whose `code` is one of the codes below. REMI also reads `reason` and `correction_distance_m`. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | The `bot_id` REMI registered, not the `fleet_serial`. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | Response 202: The command is queued. | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | The command id REMI sent. | | `state` | `'accepted' \| 'executing' \| 'succeeded' \| 'failed' \| 'rejected'` | yes | `accepted`: queued. `executing`: in progress. `succeeded`, `failed` and `rejected` are terminal. `failed`: accepted but cannot finish. `rejected`: you will not take it, with `error.code` and `rejected_at`. | | `accepted_at` | `string (date-time)` | no | Required unless `state` is `rejected`. | | `rejected_at` | `string (date-time)` | no | Required when `state` is `rejected`, absent otherwise. | | `updated_at` | `string (date-time)` | no | When `state` last changed. | | `error` | `object` | no | Set when `state` is `failed` or `rejected`. On a rejection, `code` is one of the four rejection codes. | | `error.code` | `string` | yes | | | `error.message` | `string` | yes | | | `corrected_position` | `object` | no | Where the bot will really stop when you moved a `navigate_to` destination. Only while `accepted` or `executing`. | | `corrected_position.lat` | `number` | yes | Latitude in decimal degrees, WGS 84. -90 to 90. | | `corrected_position.lng` | `number` | yes | Longitude in decimal degrees, WGS 84. -180 to 180. | | `correction_distance_m` | `number` | no | Meters between the requested destination and `corrected_position`, or, on a `DESTINATION_UNREACHABLE` rejection, your network. | Errors: | Status | Code | When | | --- | --- | --- | | 404 | `BOT_NOT_FOUND` | Unknown bot. Final: REMI does not resend. | | 409 | `COMMAND_EXPIRED` | `expires_at` is in the past. Final: REMI does not resend. | | 409 | `BOT_BUSY` | The bot cannot take the command in its current state, not transiently. Final: REMI does not resend. | | 422 | `UNSUPPORTED_COMMAND` | The bot does not support the command type or a parameter. Final: REMI does not resend. | | 422 | `DESTINATION_UNREACHABLE` | The destination is too far from your drivable network. Include `correction_distance_m`. Final: REMI does not resend. | | 500 | | Any 5xx, a timeout or a network failure means not received: REMI resends the same `id` after 10 seconds, 3 sends in total. | Example request: ```json { "id": "ES-5867/pickup", "type": "navigate_to", "params": { "lat": 4.6512, "lng": -74.0689 }, "issued_at": "2026-06-17T15:46:31.000Z" } ``` Example response: ```json { "id": "ES-5867/pickup", "state": "accepted", "accepted_at": "2026-06-17T15:46:31.220Z", "corrected_position": { "lat": 4.6513, "lng": -74.0688 }, "correction_distance_m": 14.2 } ``` ## Types ### Problem | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | `string` | yes | Always `about:blank`. | | `title` | `string` | yes | The HTTP status text. | | `status` | `integer` | yes | -9007199254740991 to 9007199254740991. | | `detail` | `string` | yes | Human-readable. Do not parse it: branch on `code`. | | `instance` | `string` | yes | The request path. | | `code` | `string` | no | Stable machine-readable error code, when the error has one. | | `params` | `Record` | no | Values that explain the error, keyed by name. | ### BotState | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `seq` | `integer` | no | Increasing per bot. A state is kept only if its `timestamp` is later than the last accepted one, or equal with a higher `seq`. Without it, states are not ordered. 0 to 9007199254740991. | | `timestamp` | `string (date-time)` | yes | When the state was measured on your side, not when it was sent. | | `available` | `boolean` | yes | Whether the bot can take new work right now, by your own verdict. Do not fold in connectivity, staleness or out of service. | | `out_of_service` | `boolean` | no | True when you took the bot out of service. Operators are alerted while it holds a job, and new `navigate_to` commands are held back. Absent means false. | | `connected` | `boolean` | yes | Whether you have a live link to the bot. In MQTT mode the broker connection decides instead. | | `position` | `object` | yes | | | `position.lat` | `number` | yes | Latitude in decimal degrees, WGS 84. -90 to 90. | | `position.lng` | `number` | yes | Longitude in decimal degrees, WGS 84. -180 to 180. | | `position.azimuth` | `number` | no | Compass bearing in degrees: 0 = North, clockwise, nominally [0, 360). | | `battery` | `object` | yes | | | `battery.percentage` | `integer` | yes | State of charge, 0 to 100. Below 20 the bot gets no new jobs. 0 to 100. | | `motion` | `object` | no | | | `motion.speed_mps` | `number` | yes | Ground speed in meters per second. | | `door` | `enum` | yes | Cargo door state. Send `unknown` when you cannot read it and `unsupported` when the bot has no controllable door, never `closed`. One of `opened`, `closed`, `opening`, `closing`, `stalled`, `unknown`, `unsupported`. | | `current_command` | `CommandStatus \| null` | yes | The latest command this bot accepted. REMI counts a command as delivered when its `id` appears here. Null if none yet. | ### BotCommand ### CommandStatus | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | The command id REMI sent. | | `state` | `'accepted' \| 'executing' \| 'succeeded' \| 'failed' \| 'rejected'` | yes | `accepted`: queued. `executing`: in progress. `succeeded`, `failed` and `rejected` are terminal. `failed`: accepted but cannot finish. `rejected`: you will not take it, with `error.code` and `rejected_at`. | | `accepted_at` | `string (date-time)` | no | Required unless `state` is `rejected`. | | `rejected_at` | `string (date-time)` | no | Required when `state` is `rejected`, absent otherwise. | | `updated_at` | `string (date-time)` | no | When `state` last changed. | | `error` | `object` | no | Set when `state` is `failed` or `rejected`. On a rejection, `code` is one of the four rejection codes. | | `error.code` | `string` | yes | | | `error.message` | `string` | yes | | | `corrected_position` | `object` | no | Where the bot will really stop when you moved a `navigate_to` destination. Only while `accepted` or `executing`. | | `corrected_position.lat` | `number` | yes | Latitude in decimal degrees, WGS 84. -90 to 90. | | `corrected_position.lng` | `number` | yes | Longitude in decimal degrees, WGS 84. -180 to 180. | | `correction_distance_m` | `number` | no | Meters between the requested destination and `corrected_position`, or, on a `DESTINATION_UNREACHABLE` rejection, your network. | ### BotEvent | Field | Type | Required | Description | | --- | --- | --- | --- | | `bot_id` | `string` | yes | | | `type` | `'arrived' \| 'blocked' \| 'unblocked'` | yes | `arrived`: a navigation finished. `blocked` and `unblocked` open and close an operator task. | | `command_id` | `string` | no | Required for `arrived`: the id of the navigation command that just completed. | | `occurred_at` | `string (date-time)` | yes | When it happened on your side, not when you sent it. | | `detail` | `Record` | no | For `blocked`: `{ "reason": string, "message": string }`. | ### FleetCapabilities | Field | Type | Required | Description | | --- | --- | --- | --- | | `supports_command_interrupt` | `boolean` | yes | Whether a `navigate_to` sent during another navigation is accepted and replaces it. Fleet-wide. Without a document this is false. | | `default` | `object` | yes | Applies to every bot unless overridden. | | `default.has_door` | `boolean` | yes | Whether the bot has a remotely controllable cargo door. False: `set_door` is never sent. | | `default.supported_commands` | `('navigate_to' \| 'cancel_navigation' \| 'set_door')[]` | yes | The command types this bot accepts. | | `overrides` | `Record` | no | Keyed by bot id and merged over `default`, field by field. Default `{}`. | --- # Engine API > Jobs, nodes and actions: the model under every delivery. Every delivery runs as an engine job. The Engine API gives you the job itself, for work a delivery does not describe: several stops, custom actions, your own hooks. ## The model A **job** is a list of **nodes** (stops) a bot visits in order. Each node has **actions** to do there. **Packages** are what the job carries. ```text Job ES-5867 ├── node pickup (point V1StGXR8Z5jdHi6BmyT2q) │ └── action load (type load, package pkg-1) └── node dropoff (lat 4.6602, lng -74.0521) └── action unload (type unload, package pkg-1) ``` - The bot drives to a node, then the node's actions run. When the last one finishes, the bot moves on. - An action is `hard` (blocks the bot and the other actions) or `soft` (blocks only the bot). - `load` and `unload` actions are handled by the engine. Other action types are yours: complete them with the API. - **Hooks** call your URL when job events match. **Events** are the job's history. ## Create a job [`POST /engine/jobs`](https://docs.remi.robot.com/engine/reference#createJob) takes the whole job in one call: ```json { "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" }] } ``` By default a bot is assigned for you (`assignation: auto`) and the job starts once the bot is free (`start: auto`). ## The calls you will use | Call | When | | --- | --- | | `POST /engine/jobs` | Create a job. | | `GET /engine/jobs/{id}` | Read it, with its nodes and actions. | | `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/complete` | Finish one of your actions. | | `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/load` | Confirm a package is in the bot. | | `POST /engine/jobs/{id}/cancel` | Call it off. | Next: [Job lifecycle](https://docs.remi.robot.com/engine/lifecycle), [Hooks and events](https://docs.remi.robot.com/engine/hooks), the [API reference](https://docs.remi.robot.com/engine/reference). ## Edits and versions Every job has a `version` that goes up on each change. Send the next version as `nextVersion` on a change to reject concurrent edits. --- # Job lifecycle > Job states and the calls that move them. ## Job states ```steps pending: Ready for a bot in_progress: A bot works on it completed: Done ``` | State | Meaning | | --- | --- | | `draft` | Being prepared. Never 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`, `canceled` | Final. | ## The calls that move it | Call | From | To | | --- | --- | --- | | [`activate`](https://docs.remi.robot.com/engine/reference#activateJob) | `draft` | `pending` | | [`schedule`](https://docs.remi.robot.com/engine/reference#scheduleJob) | `draft` | `scheduled` | | [`start`](https://docs.remi.robot.com/engine/reference#startJob) | `pending`, `scheduled` | `in_progress` | | [`pause`](https://docs.remi.robot.com/engine/reference#pauseJob) | `in_progress` | `paused` | | [`resume`](https://docs.remi.robot.com/engine/reference#resumeJob) | `paused` | `in_progress` | | [`complete`](https://docs.remi.robot.com/engine/reference#completeJob) | `in_progress` (expendable) | `completed` | | [`fail`](https://docs.remi.robot.com/engine/reference#failJob) | active | `failed` | | [`cancel`](https://docs.remi.robot.com/engine/reference#cancelJob) | active | `canceled` | All are `POST /engine/jobs/{id}/`. A job also completes on its own when its last node finishes. ## Bots - With `assignation: auto`, REMI assigns a bot. With `manual`, use [`assign-bot`](https://docs.remi.robot.com/engine/reference#assignBot). - With `start: auto`, the job starts once its bot is free. With `manual`, call `start`. - [`swap-bots`](https://docs.remi.robot.com/engine/reference#swapJobBots) and [`transfer-bot`](https://docs.remi.robot.com/engine/reference#transferJobBot) move bots between two jobs at the same location. - A job with `requiresBot: false` runs with no bot at all. ## Nodes and actions Node states: `pending`, `in_progress`, `completed`, `failed`. Action states add `paused`, `skipped` and `canceled`. - Your own action types stay `in_progress` until you [complete](https://docs.remi.robot.com/engine/reference#completeAction), [fail](https://docs.remi.robot.com/engine/reference#failAction) or [skip](https://docs.remi.robot.com/engine/reference#skipAction) them. - `load` and `unload` finish with [load](https://docs.remi.robot.com/engine/reference#loadPackage) and [unload](https://docs.remi.robot.com/engine/reference#unloadPackage): the bot closes its door and the action completes. - A node created with `released: false` waits for [release](https://docs.remi.robot.com/engine/reference#releaseNode) before the job moves on. - [`jump-to`](https://docs.remi.robot.com/engine/reference#jumpToNode) sends a running job straight to a later node. ## Concurrent edits Each job has a `version` that goes up by one on every change. To reject a change made on top of someone else's, send the current `version` plus one: `nextVersion` on the lifecycle calls, `version` on `PATCH`. A mismatch answers `JOB_VERSION_MISMATCH`. --- # Hooks and events > Get called when something happens on a job. ## Events Everything that happens to a job is recorded as an event: created, assigned, started, a node reached, an action completed, canceled. Read them with [`GET /engine/jobs/{jobId}/events`](https://docs.remi.robot.com/engine/reference#listJobEvents), oldest first. Event ids are time-ordered. ## Hooks A hook calls your URL when an event matches its filters. Add it when you create the job (`hooks`) or later with [`POST /engine/jobs/{jobId}/hooks`](https://docs.remi.robot.com/engine/reference#addHook): ```json { "name": "notify-arrival", "eventType": ["node_arrived"], "nodeName": ["dropoff"], "target": "https://example.com/hooks/remi", "metadata": { "webhook": { "method": "POST", "headers": { "X-Key": "your-secret" } } } } ``` - Filters: `eventType`, `nodeName`, `actionName`, `actionType`, `packageName` and `jobState`. A filter you leave out matches everything. - An `https://` target is a webhook. Put your secret in `metadata.webhook.headers`: calls are not signed. - The body is `{ timestamp, event, hook, jobId }`, with the [Event](https://docs.remi.robot.com/engine/reference#type-Event) that fired it. ## Order Hooks of one job that share a `queueName` run one at a time, in event order, and a failing call is retried before the next one runs. Without a `queueName`, hooks run concurrently. The [Delivery API's webhooks](https://docs.remi.robot.com/delivery/webhooks) are hooks like these, on one queue per delivery. --- # Engine API reference > Every endpoint of the Engine API. Create and operate jobs: the nodes a bot visits, the actions at each node, packages, hooks and events. - Base URL: `https://api.remi.robot.com/api/v3` - Auth: An API key with the `engine` scope, sent as `Authorization: Bearer `. Ask your Robot.com representative for one. - OpenAPI document: https://docs.remi.robot.com/openapi/engine.json ## Jobs Create, read, edit and delete jobs: a sequence of stops (nodes) for a bot, each with actions. ### Count jobs by state `GET /engine/jobs/overview` (scope `engine`) Totals for your namespace. `completedLast24h` and `failedLast24h` count jobs that reached that state in the last 24 hours. Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `locations` | `string` | no | Comma-separated location ids. Only jobs at these locations. | Response 200: The counts. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `JobOverview` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | Example response: ```json { "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 } } ``` ### List jobs `GET /engine/jobs` (scope `engine`) 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. Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `locations` | `string` | no | Comma-separated location ids. Only jobs at these locations. | | `active` | `'true' \| 'false'` | no | `true`: draft, scheduled, pending, in progress and paused jobs. `false`: completed, failed and canceled jobs. | | `limit` | `integer` | no | Page size, 1 to 1000. Default 100. 1 to 1000. Default `100`. | | `cursor_id` | `string` | no | `next_cursor.id` of the previous page. Send it with `cursor_created_at`. | | `cursor_created_at` | `string` | no | `next_cursor.createdAt` of the previous page. Send it with `cursor_id`. | | `order` | `'asc' \| 'desc'` | no | By creation time. Default `desc`. Default `"desc"`. | Response 200: A page of jobs. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job[]` | yes | | | `pagination` | `object` | yes | | | `pagination.next_cursor` | `object \| null` | yes | | | `pagination.next_cursor.id` | `string` | yes | | | `pagination.next_cursor.createdAt` | `string` | yes | | | `pagination.limit` | `number` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid query, for example `limit` above 1000. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | Example response: ```json { "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 } } ``` ### Create a job `POST /engine/jobs` (scope `engine`) Creates the job with its nodes, actions, packages and hooks in one call. - `namespace` must be your key namespace. - The response may come before the travel estimates of the nodes are calculated. Get the job again to read them. - To schedule it, send `state: scheduled` with `scheduledAt`. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `namespace` | `string` | yes | The namespace the job belongs to. Must be your API key's namespace. Up to 255 characters. | | `externalId` | `string \| null` | no | Your own reference for the job. Unique among the active jobs of the namespace. Up to 255 characters. | | `locationId` | `string` | yes | The location the job is associated with. Up to 255 characters. | | `name` | `string` | yes | The name of the job Up to 255 characters. | | `description` | `string \| null` | no | A description in markdown format. Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | URL of a picture of the job. | | `priority` | `number` | no | The priority of the job from 0 (lowest) to 100 (highest). 0 to 100. | | `expendable` | `boolean` | no | If true, the job can be ended early to free its bot without counting as failed. | | `botId` | `string \| null` | no | The bot for the job, for example `4T001`. It must be at the job's location and connected. | | `requireAvailableBot` | `boolean` | no | 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. | | `requiresBot` | `boolean` | no | 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. | | `requiredBotTags` | `string[] \| null` | no | Only bots carrying EVERY one of these bot tags are candidates. Empty or null means any bot. | | `assignation` | `'auto' \| 'manual'` | no | `auto` (default): a bot is assigned for you. `manual`: you assign it. | | `start` | `'auto' \| 'manual'` | no | `auto` (default): the job starts once a bot is assigned and free. `manual`: it waits for the start route. | | `state` | `'draft' \| 'scheduled' \| 'pending' \| 'in_progress'` | no | Initial state. Defaults to `pending`. `scheduled` needs `scheduledAt`. | | `tags` | `string[] \| null` | no | Labels for searching and filtering. | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `nodes` | `NewNode[] \| null` | no | The stops of the job, in visiting order. | | `hooks` | `NewHook[] \| null` | no | | | `packages` | `NewPackage[] \| null` | no | | | `scheduledAt` | `string (date-time) \| null` | no | When the job should reach its first node. Required with `state: scheduled`. | | `targetCompletionAt` | `string (date-time) \| null` | no | When the job is expected to finish. | Response 201: The created job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `HOOK_ACTION_NOT_ALLOWED` | `action` is not `call_webhook`, or `target` is not an `http(s)` URL. | | 400 | `POINT_NOT_FOUND` | A node `pointId` is not a point of the job location. | | 400 | `BOTLESS_JOB_CANNOT_HAVE_BOT` | `requiresBot` is false together with `botId` or `requireAvailableBot`. | | 400 | `BOTLESS_JOB_MUST_BE_MANUAL_ASSIGNATION` | `requiresBot` is false and `assignation` is not `manual`. | | 400 | `STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD` | A load action without `packageName` covers packages of more than one station. | | 400 | `INVALID_BOT` | `botId` does not exist or is at another location. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 403 | | `namespace` is not your key namespace. | | 409 | `NO_AVAILABLE_BOT` | With `requireAvailableBot` and no `botId`: no bot is available. | | 409 | `BOT_UNAVAILABLE` | `botId` is retired, off duty, not connected, or belongs to another partner. | | 409 | `BOT_BUSY` | `state` is `in_progress` and `botId` is on another job. | Example request: ```json { "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 } ] } ] } ``` Example response: ```json { "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" } ] } } ``` ### Get the active job of a bot `GET /engine/jobs/by-bot/{botId}` (scope `engine`) The in-progress or paused job of the bot. `data` is null when the bot has none. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `botId` | `string` | yes | Bot id, for example `4T001`. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `include_hooks` | `'true' \| 'false'` | no | `true` to include the job hooks. | | `include_events` | `'true' \| 'false'` | no | `true` to include the job events. | | `include_alerts` | `'true' \| 'false'` | no | `true` to include the job alerts. | Response 200: The job, or null. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job \| null` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | Example response: ```json { "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" } ] } } ``` ### Get a job `GET /engine/jobs/{id}` (scope `engine`) Includes nodes, actions and packages. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `include_hooks` | `'true' \| 'false'` | no | `true` to include the job hooks. | | `include_events` | `'true' \| 'false'` | no | `true` to include the job events. | | `include_alerts` | `'true' \| 'false'` | no | `true` to include the job alerts. | Response 200: The job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example response: ```json { "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" } ] } } ``` ### Update a job `PATCH /engine/jobs/{id}` (scope `engine`) Send only what changes. `state` moves the job like the lifecycle routes, and `botId` assigns the bot (null unassigns it). Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `externalId` | `string \| null` | no | Your own reference for the job. Unique among the active jobs of the namespace. Up to 255 characters. | | `name` | `string` | no | The name of the job Up to 255 characters. | | `description` | `string \| null` | no | A description in markdown format. Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | URL of a picture of the job. | | `priority` | `number` | no | The priority of the job from 0 (lowest) to 100 (highest). 0 to 100. | | `expendable` | `boolean` | no | If true, the job can be ended early to free its bot without counting as failed. | | `botId` | `string \| null` | no | The bot for the job, for example `4T001`. It must be at the job's location and connected. | | `requiredBotTags` | `string[] \| null` | no | Only bots carrying EVERY one of these bot tags are candidates. Empty or null means any bot. | | `state` | `enum` | no | Move the job to this state. One of `draft`, `scheduled`, `pending`, `in_progress`, `paused`, `canceled`, `completed`, `failed`. | | `tags` | `string[] \| null` | no | Labels for searching and filtering. | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `version` | `number` | no | The version of the job. Must match the next version of the job to update it. | | `scheduledAt` | `string (date-time) \| null` | no | When the job should reach its first node. Required with `state: scheduled`. | | `targetCompletionAt` | `string (date-time) \| null` | no | When the job is expected to finish. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | | 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`. | | 400 | `CANNOT_START_JOB_NO_BOT` | `state` is `in_progress` and the job has no bot. | | 400 | `ASSIGN_BOT_JOB_DOES_NOT_REQUIRE_BOT` | `botId` is set on a job with `requiresBot` false. | | 400 | `ASSIGN_BOT_JOB_FINALIZED` | `botId` is set on a finished job. | | 400 | `UNASSIGN_BOT_JOB_IN_PROGRESS` | `botId` is null on an in-progress job. | | 400 | `JOB_SCHEDULED_AT_REQUIRED` | `state` is `scheduled`. Use the schedule route instead. | | 400 | `INVALID_BOT` | The bot does not exist or is at another location. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `version` is not the current `version` plus one. | | 409 | `BOT_UNAVAILABLE` | The bot is retired, off duty, not connected, or belongs to another partner. | | 409 | `BOT_BUSY` | The job is in progress and the bot is on another job. | ### Delete a draft job `DELETE /engine/jobs/{id}` (scope `engine`) Only drafts can be deleted. Cancel any other job. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Response 200: The job was deleted. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.deleted` | `true` | yes | | | `data.id` | `string` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | The job is not a draft. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example response: ```json { "data": { "deleted": true, "id": "ES-5868" } } ``` ## Job lifecycle Move a job through its states and decide which bot works on it. ### Start a job `POST /engine/jobs/{id}/start` (scope `engine`) Moves a pending or scheduled job to `in_progress`. It needs a bot unless `requiresBot` is false. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `CANNOT_START_JOB_NO_BOT` | The job has no bot and needs one. | | 400 | `START_JOB_INVALID_STATE` | The job is not pending or scheduled. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Pause a job `POST /engine/jobs/{id}/pause` (scope `engine`) Stops the bot and pauses the running actions. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `PAUSE_JOB_INVALID_STATE` | The job is not in progress. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Resume a paused job `POST /engine/jobs/{id}/resume` (scope `engine`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `RESUME_JOB_INVALID_STATE` | The job is not paused. | | 400 | `RESUME_JOB_NO_BOT` | The job has no bot and needs one. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Cancel a job `POST /engine/jobs/{id}/cancel` (scope `engine`) Stops the bot, cancels the unfinished actions and frees the bot. A canceled job cannot be resumed. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Why. Stored in the job `metadata.finalizationReason` unless one is already set. | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `CANCEL_JOB_ALREADY_FINALIZED` | The job is already completed, failed or canceled. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | Example request: ```json { "reason": "Customer canceled the order" } ``` Example response: ```json { "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" } ] } } ``` ### Complete a job early `POST /engine/jobs/{id}/complete` (scope `engine`) Only for an in-progress job that is expendable, or whose current node is. Cancels the unfinished actions and frees the bot. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `COMPLETE_JOB_INVALID_STATE` | The job is not in progress. | | 400 | `COMPLETE_JOB_NOT_EXPENDABLE` | Neither the job nor its current node is expendable. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Fail a job `POST /engine/jobs/{id}/fail` (scope `engine`) Stops the bot, cancels the unfinished actions and frees the bot. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Why. Stored in the job `metadata.finalizationReason` unless one is already set. | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `FAIL_JOB_ALREADY_FINALIZED` | The job is already completed, failed or canceled. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Activate a draft job `POST /engine/jobs/{id}/activate` (scope `engine`) Moves a draft to `pending`. The job needs at least one node, and unique node, action and package names. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `ACTIVATE_JOB_INVALID_STATE` | The job is not a draft. | | 400 | `VALIDATE_JOB_NO_NODES` | The job has no nodes. | | 400 | `VALIDATE_JOB_DUPLICATE_NODE` | Two nodes share a name. | | 400 | `VALIDATE_JOB_DUPLICATE_ACTION` | Two actions of a node share a name. | | 400 | `VALIDATE_JOB_DUPLICATE_PACKAGE` | Two packages share a name. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Schedule a job `POST /engine/jobs/{id}/schedule` (scope `engine`) Moves a draft, or an already scheduled job, to `scheduled` for the given time. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `scheduledAt` | `string (date-time)` | yes | When the job should reach its first node, as an ISO 8601 timestamp. | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `SCHEDULE_JOB_INVALID_STATE` | The job is not a draft or scheduled. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | Example request: ```json { "scheduledAt": "2026-06-17T18:00:00.000Z" } ``` ### Assign a bot `POST /engine/jobs/{id}/assign-bot` (scope `engine`) 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. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `botId` | `string` | yes | The bot to assign, for example `4T001`. | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `ASSIGN_BOT_JOB_DOES_NOT_REQUIRE_BOT` | The job has `requiresBot` false. | | 400 | `ASSIGN_BOT_JOB_FINALIZED` | The job is completed, failed or canceled. | | 400 | `INVALID_BOT` | The bot does not exist or is at another location. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | | 409 | `BOT_UNAVAILABLE` | The bot is retired, off duty, not connected, or belongs to another partner. | | 409 | `BOT_BUSY` | The job is in progress and the bot is on another job. | Example request: ```json { "botId": "4T001" } ``` ### Unassign the bot `POST /engine/jobs/{id}/unassign-bot` (scope `engine`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `UNASSIGN_BOT_JOB_IN_PROGRESS` | The job is in progress. Pause it or assign another bot. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | ### Swap the bots of two jobs `POST /engine/jobs/swap-bots` (scope `engine`) Both jobs need a bot, must be at the same location, and must not be finished. The swap is atomic. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId1` | `string` | yes | | | `jobId2` | `string` | yes | | | `nextVersion1` | `number` | no | Expected version of `jobId1` after the swap: its current `version` plus one. | | `nextVersion2` | `number` | no | Expected version of `jobId2` after the swap: its current `version` plus one. | Response 200: Both jobs after the swap. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.job1` | `Job` | yes | | | `data.job2` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `CANNOT_SWAP_SAME_JOB` | `jobId1` and `jobId2` are the same. | | 400 | `NO_BOTS_TO_SWAP` | A job has no bot. | | 400 | `UPDATE_JOB_LOCATION_NOT_DRAFT` | The jobs are at different locations. | | 400 | `INVALID_BOT` | A bot is not valid for the other job. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | | 409 | `CANNOT_SWAP_FINALIZED_JOB` | A job is completed, failed or canceled. | | 409 | `SAME_BOT_ASSIGNED` | Both jobs already have the same bot. | | 409 | `BOT_UNAVAILABLE` | A bot is busy with a third job and the other job is in progress. | Example request: ```json { "jobId1": "ES-5867", "jobId2": "ES-5870" } ``` ### Move a bot to another job `POST /engine/jobs/transfer-bot` (scope `engine`) The source job loses its bot and the target job gets it. Both jobs must be at the same location and not be finished. Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `sourceJobId` | `string` | yes | The job that gives up its bot. | | `targetJobId` | `string` | yes | The job that receives the bot. | | `nextVersionSource` | `number` | no | Expected version of the source job after the transfer: its current `version` plus one. | | `nextVersionTarget` | `number` | no | Expected version of the target job after the transfer: its current `version` plus one. | Response 200: Both jobs after the transfer. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.sourceJob` | `Job` | yes | | | `data.targetJob` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `CANNOT_SWAP_SAME_JOB` | `sourceJobId` and `targetJobId` are the same. | | 400 | `NO_BOT_ASSIGNED` | The source job has no bot. | | 400 | `UPDATE_JOB_LOCATION_NOT_DRAFT` | The jobs are at different locations. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | | 409 | `CANNOT_SWAP_FINALIZED_JOB` | A job is completed, failed or canceled. | Example request: ```json { "sourceJobId": "ES-5867", "targetJobId": "ES-5870" } ``` ### Jump to a node `POST /engine/jobs/{id}/jump-to` (scope `engine`) Sends an in-progress job straight to a later node, skipping the ones in between. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `nodeName` | `string` | yes | The node to go to. It must come after the current one and not be finished. | | `nextVersion` | `number` | no | Expected job version after this change: the current `version` plus one. If the job changed meanwhile the call fails with `JOB_VERSION_MISMATCH`. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `JUMP_TO_NODE_INVALID_STATE` | The job is not in progress. | | 400 | `JUMP_TO_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `JUMP_TO_NODE_NOT_AFTER_CURRENT` | The node is not after the current one. | | 400 | `JUMP_TO_NODE_ALREADY_FINALIZED` | The node is already completed or failed. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `JOB_VERSION_MISMATCH` | `nextVersion` is not the current `version` plus one. | Example request: ```json { "nodeName": "dropoff" } ``` ## Nodes The stops of a job. ### Add a node `POST /engine/jobs/{jobId}/nodes` (scope `engine`) Adds a stop to the job, with its actions. On an active job it cannot go before or at the current node. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `node` | `NewNode` | yes | | | `atIndex` | `number` | no | Position to insert the node at. Default: the end. | | `jumpToImmediately` | `boolean` | no | On an in-progress job, send the bot to the new node right away, skipping the nodes in between. | Response 201: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `ADD_NODE_NAME_DUPLICATE` | The job already has a node with this name. | | 400 | `ADD_NODE_INDEX_OUT_OF_BOUNDS` | `atIndex` is outside the job nodes. | | 400 | `ADD_NODE_BEFORE_CURRENT` | The job is active and `atIndex` is at or before the current node. | | 400 | `POINT_NOT_FOUND` | `pointId` is not a point of the job location. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "node": { "name": "return", "lat": 4.6498, "lng": -74.0712 } } ``` ### Update a node `PATCH /engine/jobs/{jobId}/nodes/{nodeName}` (scope `engine`) 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. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | no | The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens. Up to 255 characters. | | `pointId` | `string` | no | Move the node to this point of the job location. | | `lat` | `number \| null` | no | -90 to 90. | | `lng` | `number \| null` | no | -180 to 180. | | `azimuth` | `number \| null` | no | | | `released` | `boolean` | no | | | `expendable` | `boolean` | no | | | `allowFailure` | `boolean` | no | | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `description` | `string \| null` | no | Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `UPDATE_NODE_NAME_NOT_PENDING` | Renaming a node that is not pending. | | 400 | `UPDATE_NODE_NAME_DUPLICATE` | The new name is taken by another node. | | 400 | `UPDATE_NODE_POSITION_NOT_PENDING` | Moving a node that is neither pending nor the current one. | | 400 | `UPDATE_NODE_POSITION_ARRIVED` | Moving a node the bot already arrived at. | | 400 | `POINT_NOT_FOUND` | `pointId` is not a point of the job location. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "lat": 4.6605, "lng": -74.0525 } ``` ### Delete a node `DELETE /engine/jobs/{jobId}/nodes/{nodeName}` (scope `engine`) On an active job, only a pending node can be deleted. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `DELETE_NODE_NOT_PENDING` | The job is active and the node is not pending. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Release a held node `POST /engine/jobs/{jobId}/nodes/{nodeName}/release` (scope `engine`) Lets the job move on from a node created with `released` false. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Mark a node as arrived `POST /engine/jobs/{jobId}/nodes/{nodeName}/arrive` (scope `engine`) Records that the bot reached the node. The node must be in progress and have coordinates. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `ARRIVE_NODE_NOT_IN_PROGRESS` | The node is not in progress. | | 400 | `ARRIVE_NODE_ALREADY_ARRIVED` | The node already has an arrival. | | 400 | `ARRIVE_NODE_NO_POSITION` | The node has no coordinates. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Update travel estimates `POST /engine/jobs/{jobId}/nodes/{nodeName}/update-estimations` (scope `engine`) Sets the travel time to a node the bot is driving to. The node must be in progress, departed and not yet arrived. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `newTravelDuration` | `number` | yes | New estimated travel time to the node, in milliseconds. | | `arriving` | `boolean` | yes | True when the bot is about to arrive. The node then becomes `arriving`. | Response 200: Whether the node became `arriving`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.arriving` | `boolean` | yes | True when this call moved the node to `arriving`. | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `UPDATE_NODE_ESTIMATIONS_INVALID_STATE` | The node is not in progress, has not departed, or already arrived. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "newTravelDuration": 45000, "arriving": true } ``` Example response: ```json { "data": { "arriving": true } } ``` ## Actions What happens at a node, such as loading or unloading a package. ### Add an action `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions` (scope `engine`) Adds an action to a node, not before the actions that already started. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `action` | `NewAction` | yes | | | `atIndex` | `number` | no | Position to insert the action at. Default: the end. | Response 201: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `ADD_ACTION_NAME_DUPLICATE` | The node already has an action with this name. | | 400 | `ADD_ACTION_INDEX_OUT_OF_BOUNDS` | `atIndex` is outside the node actions. | | 400 | `ADD_ACTION_NODE_IN_PAST` | The node is before the current one. | | 400 | `ADD_ACTION_BEFORE_CURRENT` | `atIndex` is before an action that already started. | | 400 | `ADD_ACTION_PACKAGE_NOT_FOUND` | `packageName` is not a package of the job. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "action": { "name": "unload-2", "type": "unload", "packageName": "pkg-2" } } ``` ### Update an action `PATCH /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}` (scope `engine`) An action can be renamed only while pending. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | no | The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens. Up to 255 characters. | | `type` | `string` | no | Up to 255 characters. | | `packageName` | `string \| null` | no | | | `bundleName` | `string \| null` | no | The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens. Up to 255 characters. | | `blockingType` | `'soft' \| 'hard'` | no | | | `allowFailure` | `boolean` | no | | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `GET_ACTION_NOT_FOUND` | The node has no action with this name. | | 400 | `UPDATE_ACTION_NAME_NOT_PENDING` | Renaming an action that is not pending. | | 400 | `UPDATE_ACTION_NAME_DUPLICATE` | The new name is taken by another action of the node. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Delete an action `DELETE /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}` (scope `engine`) On an active job, only a pending action can be deleted. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `GET_ACTION_NOT_FOUND` | The node has no action with this name. | | 400 | `DELETE_ACTION_NOT_PENDING` | The job is active and the action is not pending. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Complete an action `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/complete` (scope `engine`) The action must be in progress. When it was the last one of the node, the job moves on. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `GET_ACTION_NOT_FOUND` | The node has no action with this name. | | 400 | `COMPLETE_ACTION_NOT_IN_PROGRESS` | The action is not in progress. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Fail an action `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/fail` (scope `engine`) The action must be in progress. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Why. Stored in the action `metadata.finalizationReason` unless one is already set. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `GET_ACTION_NOT_FOUND` | The node has no action with this name. | | 400 | `FAIL_ACTION_NOT_IN_PROGRESS` | The action is not in progress. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Skip an action `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/skip` (scope `engine`) The action must be pending or in progress. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Why. Stored in the action `metadata.finalizationReason` unless one is already set. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `GET_ACTION_NOT_FOUND` | The node has no action with this name. | | 400 | `SKIP_ACTION_INVALID_STATE` | The action is neither pending nor in progress. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Cancel an action `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/cancel` (scope `engine`) The action must be pending, in progress or paused. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | `string` | no | Why. Stored in the action `metadata.finalizationReason` unless one is already set. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_NODE_NOT_FOUND` | The job has no node with this name. | | 400 | `GET_ACTION_NOT_FOUND` | The node has no action with this name. | | 400 | `CANCEL_ACTION_INVALID_STATE` | The action is already finished. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Confirm a package is loaded `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/load` (scope `engine`) 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. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `skipCloseDoor` | `boolean` | no | Do not close the door first. | | `allowDoorClosingFailure` | `boolean` | no | Go on when the door cannot be closed. The result tells whether it failed. | | `verification` | `'vri' \| null` | no | `vri`: check with the bot first that the package is inside (load) or gone (unload). If the check fails, the action stays in progress. | Response 200: The result. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `LoadUnloadResult` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 404 | `NODE_NOT_FOUND` | The job has no node with this name. | | 404 | `ACTION_NOT_FOUND` | The node has no action with this name. | | 409 | `CANNOT_LOAD_ACTION_NOT_IN_PROGRESS` | The action is not in progress. | | 409 | `CANNOT_LOAD_ACTION_NOT_LOAD_OR_UNLOAD` | The action type is not `load` or `unload`. | | 409 | `NO_BOT_ASSIGNED` | The job has no bot. | | 409 | `CANNOT_CLOSE_DOOR` | The door did not close and `allowDoorClosingFailure` is not set. | Example request: ```json { "verification": "vri" } ``` Example response: ```json { "data": { "success": true, "doorClosedFailed": false, "botId": "4T001", "verificationResult": "success" } } ``` ### Confirm a package is unloaded `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/unload` (scope `engine`) 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. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body (optional): | Field | Type | Required | Description | | --- | --- | --- | --- | | `skipCloseDoor` | `boolean` | no | Do not close the door first. | | `allowDoorClosingFailure` | `boolean` | no | Go on when the door cannot be closed. The result tells whether it failed. | | `verification` | `'vri' \| null` | no | `vri`: check with the bot first that the package is inside (load) or gone (unload). If the check fails, the action stays in progress. | Response 200: The result. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `LoadUnloadResult` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 404 | `NODE_NOT_FOUND` | The job has no node with this name. | | 404 | `ACTION_NOT_FOUND` | The node has no action with this name. | | 409 | `CANNOT_LOAD_ACTION_NOT_IN_PROGRESS` | The action is not in progress. | | 409 | `CANNOT_LOAD_ACTION_NOT_LOAD_OR_UNLOAD` | The action type is not `load` or `unload`. | | 409 | `NO_BOT_ASSIGNED` | The job has no bot. | | 409 | `CANNOT_CLOSE_DOOR` | The door did not close and `allowDoorClosingFailure` is not set. | ## Packages The packages a job carries. ### Add a package `POST /engine/jobs/{jobId}/packages` (scope `engine`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | The name of the package. Must be unique per job. Up to 255 characters. | | `bundleName` | `string \| null` | no | Group identifier for the package. Up to 255 characters. | | `description` | `string \| null` | no | A description in markdown format. Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | URL of a picture of the package. | | `items` | `{ name: string, quantity: number } & Record[] \| null` | no | What is inside. Each item needs `name` and `quantity` (at least 1); other fields are kept. | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `station` | `string \| null` | no | Prep station that owns this package (e.g. "Burger Shop"). Trimmed; blank becomes null. | Response 201: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `ADD_PACKAGE_NAME_DUPLICATE` | The job already has a package with this name. | | 400 | `STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD` | A load action without `packageName` would cover packages of more than one station. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "name": "pkg-2", "station": "Drinks", "items": [ { "name": "Lemonade", "quantity": 2 } ] } ``` ### Update a package `PATCH /engine/jobs/{jobId}/packages/{packageName}` (scope `engine`) A package can be renamed only while none of its actions started. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `packageName` | `string` | yes | Package name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | no | The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens. Up to 255 characters. | | `bundleName` | `string \| null` | no | The name of the entity. Must only contain alphanumeric characters, underscores, and hyphens. Up to 255 characters. | | `description` | `string \| null` | no | Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | | | `items` | `{ name: string, quantity: number } & Record[] \| null` | no | | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `station` | `string \| null` | no | Prep station that owns this package. Trimmed; blank becomes null. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `GET_PACKAGE_NOT_FOUND` | The job has no package with this name. | | 400 | `UPDATE_PACKAGE_NAME_DUPLICATE` | The new name is taken by another package. | | 400 | `UPDATE_PACKAGE_NAME_IN_USE` | Renaming a package whose actions already started. | | 400 | `STATIONED_PACKAGES_REQUIRE_PER_PACKAGE_LOAD` | A load action without `packageName` would cover packages of more than one station. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Delete a package `DELETE /engine/jobs/{jobId}/packages/{packageName}` (scope `engine`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `packageName` | `string` | yes | Package name. | Response 200: The updated job. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Job` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | `GET_PACKAGE_NOT_FOUND` | The job has no package with this name. | | 400 | `DELETE_PACKAGE_IN_USE` | An action that uses the package already started. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ## Hooks Calls a webhook, or runs another action, when job events match its filters. ### Add a hook `POST /engine/jobs/{jobId}/hooks` (scope `engine`) The hook fires on every event that matches its filters. A filter you leave out matches everything. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | The name of the hook. Must be unique per job. Up to 255 characters. | | `eventType` | `enum[] \| null` | no | Fire only for these event types. Omit for all. | | `nodeName` | `string[] \| null` | no | Filter events to specific nodes by their names. | | `actionName` | `string[] \| null` | no | Filter events to specific actions by their names. | | `packageName` | `string[] \| null` | no | Filter events to specific packages by their names. | | `jobState` | `enum[] \| null` | no | Fire only while the job is in one of these states. Omit for all. | | `action` | `'call_webhook'` | no | Only `call_webhook`. Inferred from an `https://` or `http://` `target` when omitted. | | `target` | `string` | no | The URL to call. | | `queueName` | `string \| null` | no | 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. Up to 255 characters. | | `metadata` | `Record \| null` | no | 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). | Response 201: The created hook. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Hook` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `HOOK_ACTION_AND_TARGET_UNDEFINED` | No `action`, and `target` has no recognizable scheme. | | 400 | `HOOK_ACTION_NOT_ALLOWED` | `action` is not `call_webhook`, or `target` is not an `http(s)` URL. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 409 | `DUPLICATE_HOOK_NAME` | The job already has a hook with this name. | Example request: ```json { "name": "notify-partner", "target": "https://example.com/hooks/engine", "eventType": [ "job_started", "job_finalized" ] } ``` Example response: ```json { "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 } } ``` ### Update a hook `PATCH /engine/jobs/{jobId}/hooks/{hookName}` (scope `engine`) Send only what changes. The name cannot change. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `hookName` | `string` | yes | Hook name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `eventType` | `enum[] \| null` | no | Fire only for these event types. Omit for all. | | `nodeName` | `string[] \| null` | no | Filter events to specific nodes by their names. | | `actionName` | `string[] \| null` | no | Filter events to specific actions by their names. | | `packageName` | `string[] \| null` | no | Filter events to specific packages by their names. | | `jobState` | `enum[] \| null` | no | Fire only while the job is in one of these states. Omit for all. | | `action` | `'call_webhook'` | no | Only `call_webhook`. Inferred from an `https://` or `http://` `target` when omitted. | | `target` | `string` | no | The URL to call. | | `queueName` | `string \| null` | no | 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. Up to 255 characters. | | `metadata` | `Record \| null` | no | 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). | Response 200: The updated hook. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Hook` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | `HOOK_ACTION_NOT_ALLOWED` | `action` is not `call_webhook`, or `target` is not an `http(s)` URL. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 404 | `HOOK_NOT_FOUND` | The job has no hook with this name. | ### Delete a hook `DELETE /engine/jobs/{jobId}/hooks/{hookName}` (scope `engine`) Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `hookName` | `string` | yes | Hook name. | Response 200: The hook was deleted. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.deleted` | `boolean` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 404 | `HOOK_NOT_FOUND` | The job has no hook with this name. | Example response: ```json { "data": { "deleted": true } } ``` ## Events The history of what happened to a job. ### List the events of a job `GET /engine/jobs/{jobId}/events` (scope `engine`) Oldest first. Pass `pagination.next_cursor` as `cursor` to get the next page; it is null on the last page. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Page size, 1 to 50. Default 50. 1 to 50. Default `50`. | | `cursor` | `string` | no | `next_cursor` of the previous page. | Response 200: A page of events. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Event[]` | yes | | | `pagination` | `object` | yes | | | `pagination.next_cursor` | `string \| null` | yes | | | `pagination.limit` | `number` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid query, for example `limit` above 50. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example response: ```json { "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 } } ``` ## Alerts Problems raised on a job. ### List the alerts of a job `GET /engine/jobs/{jobId}/alerts` (scope `engine`) Oldest first. Pass `pagination.next_cursor` as `cursor` to get the next page; it is null on the last page. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Page size, 1 to 100. Default 50. 1 to 100. Default `50`. | | `cursor` | `string` | no | `next_cursor` of the previous page. | | `name` | `string` | no | Only alerts with this name. | Response 200: A page of alerts. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Alert[]` | yes | | | `pagination` | `object` | yes | | | `pagination.next_cursor` | `string \| null` | yes | | | `pagination.limit` | `number` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid query, for example `limit` above 100. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | ### Raise an alert on a job `POST /engine/jobs/{jobId}/alerts` (scope `engine`) The location, bot and job version are filled in from the job. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | Category of the alert. | | `description` | `string` | yes | Markdown. | | `priority` | `integer` | no | From 0 (lowest) to 100 (highest). Default 0. 0 to 100. Default `0`. | | `metadata` | `Record \| null` | no | | Response 201: The created alert. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Alert` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "name": "pickup-delay", "description": "The kitchen is 10 minutes late.", "priority": 50 } ``` Example response: ```json { "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 } } ``` ### List alerts across jobs `GET /engine/alerts` (scope `engine`) 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. Query parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `integer` | no | Page size, 1 to 100. Default 50. 1 to 100. Default `50`. | | `cursor_id` | `string` | no | `next_cursor.id` of the previous page. Send it with `cursor_created_at`. | | `cursor_created_at` | `string` | no | `next_cursor.created_at` of the previous page. Send it with `cursor_id`. | | `order` | `'asc' \| 'desc'` | no | By creation time. Default `desc`. Default `"desc"`. | | `locations` | `string` | no | Comma-separated location ids. Only jobs at these locations. | | `name` | `string` | no | Only alerts with this name. | Response 200: A page of alerts. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `Alert[]` | yes | | | `pagination` | `object` | yes | | | `pagination.next_cursor` | `object \| null` | yes | | | `pagination.next_cursor.id` | `string` | yes | | | `pagination.next_cursor.created_at` | `string` | yes | | | `pagination.limit` | `number` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid query, for example `limit` above 100. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | Example response: ```json { "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 } } ``` ## Bots Control a bot directly: its door and its screen. ### Open or close the door during an action `POST /engine/jobs/{jobId}/nodes/{nodeName}/actions/{actionName}/door` (scope `engine`) Moves the door of the job bot. The job must be active with a bot, and the action in progress. 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`. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | | `nodeName` | `string` | yes | Node name. | | `actionName` | `string` | yes | Action name. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `state` | `'open' \| 'closed'` | yes | The door state to reach. | Response 200: The door result. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `DoorResult` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | | The job is not in progress or paused, has no bot, or the action is not in progress. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | | 404 | | The node has no action with this name. | Example request: ```json { "state": "open" } ``` Example response: ```json { "data": { "success": true, "missionCreated": false, "failureReason": null, "lastDoorState": "opened" } } ``` ### Open or close a bot door `POST /engine/bots/{botId}/actions/door` (scope `engine`) 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`. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `botId` | `string` | yes | Bot id, for example `4T001`. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `state` | `'open' \| 'closed'` | yes | The door state to reach. | Response 200: The door result. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `DoorResult` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 403 | | The bot is not one of yours and has no active job of yours. | | 404 | | No bot with this id. | Example request: ```json { "state": "closed" } ``` Example response: ```json { "data": { "success": false, "missionCreated": false, "failureReason": "timeout", "lastDoorState": "closing" } } ``` ### Play a screen animation `POST /engine/bots/{botId}/actions/animation` (scope `engine`) Sent to the bot without waiting for it to play. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `botId` | `string` | yes | Bot id, for example `4T001`. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `animationId` | `integer` | yes | Screen animation id. Known: 2 to 14 (dark background) and 15 to 27 (white background). 0 to 9007199254740991. | | `keepFixed` | `boolean` | no | Keep the animation on the screen. Default true. Default `true`. | Response 200: The animation was sent. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `object` | yes | | | `data.success` | `boolean` | yes | | | `data.botId` | `string` | yes | | | `data.action` | `string` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 403 | | The bot is not one of yours and has no active job of yours. | | 404 | | No bot with this id. | Example request: ```json { "animationId": 5, "keepFixed": true } ``` Example response: ```json { "data": { "success": true, "botId": "4T001", "action": "animation" } } ``` ### Open or close the door of a job bot `POST /engine/jobs/{jobId}/bot/actions/door` (scope `engine`) The job must be in progress or paused, with a bot. 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`. Path parameters: | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | Job id. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `state` | `'open' \| 'closed'` | yes | The door state to reach. | Response 200: The door result. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | `DoorResult` | yes | | Errors: | Status | Code | When | | --- | --- | --- | | 400 | | Invalid body. | | 400 | | The job is not in progress or paused, or has no bot. | | 401 | | Missing or invalid API key. | | 403 | | The API key does not have the `engine` scope. | | 404 | | No job with this id in your namespace. | Example request: ```json { "state": "open" } ``` ## Types ### Problem | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | `string` | yes | Always `about:blank`. | | `title` | `string` | yes | The HTTP status text. | | `status` | `integer` | yes | -9007199254740991 to 9007199254740991. | | `detail` | `string` | yes | Human-readable. Do not parse it: branch on `code`. | | `instance` | `string` | yes | The request path. | | `code` | `string` | no | Stable machine-readable error code, when the error has one. | | `params` | `Record` | no | Values that explain the error, keyed by name. | ### Job | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | yes | Job id, usually like `ES-5867`. Treat it as an opaque string. | | `namespace` | `string` | yes | The namespace that owns the job. | | `externalId` | `string \| null` | yes | Your own reference. Unique among your active jobs. | | `locationId` | `string` | yes | | | `version` | `number` | yes | Increases by one on every change. Send the current value plus one as `nextVersion` to reject concurrent edits. | | `name` | `string` | yes | | | `description` | `string \| null` | yes | Markdown. | | `pictureURL` | `string \| null` | yes | | | `assignation` | `'auto' \| 'manual'` | yes | `auto`: a bot is assigned for you. `manual`: you assign it. | | `start` | `'auto' \| 'manual'` | yes | `auto`: starts once a bot is assigned and free. `manual`: waits for the start route. | | `state` | `JobState` | yes | | | `currentNodeIndex` | `number \| null` | yes | `index` of the node in progress. Null until the job starts. | | `priority` | `number` | yes | From 0 (lowest) to 100 (highest). | | `expendable` | `boolean` | yes | True if the job can be ended early to free its bot without counting as failed. | | `createdManually` | `boolean` | yes | True when a person created the job in the REMI app, false when it came from the API. | | `scheduledAt` | `string (date-time) \| null` | yes | When the job should reach its first node. | | `targetCompletionAt` | `string (date-time) \| null` | yes | When the job is expected to finish. | | `startedAt` | `string (date-time) \| null` | yes | | | `finalizedAt` | `string (date-time) \| null` | yes | When the job reached a final state. | | `botId` | `string \| null` | yes | The assigned bot, for example `4T001`. | | `requiresBot` | `boolean` | yes | False for a job that runs without a bot. | | `requiredBotTags` | `string[] \| null` | yes | Only bots with every one of these tags can take the job. Null or empty: any bot. | | `createdAt` | `string (date-time)` | yes | | | `updatedAt` | `string (date-time) \| null` | yes | | | `tags` | `string[] \| null` | yes | | | `metadata` | `unknown` | yes | Free-form JSON object, or null. | | `nodes` | `Node[]` | yes | In visiting order. | | `hooks` | `Hook[]` | no | Only with `include_hooks=true`. | | `alerts` | `Alert[]` | no | Only with `include_alerts=true`. | | `packages` | `Package[]` | yes | | | `events` | `Event[]` | no | Only with `include_events=true`. | ### JobState `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 | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | | | `name` | `string` | yes | Unique within the job. | | `description` | `string \| null` | yes | Markdown. | | `pictureURL` | `string \| null` | yes | | | `index` | `number` | yes | Position in the job, from 0. | | `pointId` | `string \| null` | yes | The registered point this node was created from, if any. | | `lat` | `number \| null` | yes | | | `lng` | `number \| null` | yes | | | `azimuth` | `number \| null` | yes | | | `positionIndex` | `number \| null` | yes | Position among the nodes that have coordinates. | | `hasPositionDefined` | `boolean` | yes | True when `lat` and `lng` are set. | | `distance` | `number` | yes | Estimated distance to the next node. | | `travelDuration` | `number` | yes | Estimated travel time to this node, in milliseconds. | | `actionsDuration` | `number` | yes | Estimated time of the actions at this node, in milliseconds. | | `totalDuration` | `number` | yes | Estimated time at this node in milliseconds: travel plus the actions that cannot run in parallel. | | `estimatedArrivalAt` | `string (date-time) \| null` | yes | Estimated arrival, or the real one once the bot arrived. It can be stale between updates. | | `startedAt` | `string (date-time) \| null` | yes | | | `departedAt` | `string (date-time) \| null` | yes | When the bot left for this node. | | `arrivedAt` | `string (date-time) \| null` | yes | When the bot arrived at this node. | | `finalizedAt` | `string (date-time) \| null` | yes | | | `state` | `NodeState` | yes | | | `transitState` | `'in_transit' \| 'arriving' \| 'interrupted' \| null` | yes | `in_transit`: the bot is driving here. `arriving`: it is close. `interrupted`: the leg was abandoned. | | `allowFailure` | `boolean` | yes | The job continues if this node fails. | | `expendable` | `boolean` | yes | The job can be ended early at this node without counting as failed. | | `tags` | `string[] \| null` | yes | | | `released` | `boolean` | yes | If false, the node waits for the release route before the job moves on. | | `metadata` | `unknown` | yes | Free-form JSON object, or null. | | `actions` | `Action[]` | yes | In execution order. | ### NodeState ### Action | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | | | `nodeName` | `string` | yes | | | `name` | `string` | yes | Unique within the node. | | `index` | `number` | yes | Position in the node, from 0. | | `type` | `string` | yes | What the action does. `load` and `unload` are handled by the engine; other values are free-form. | | `blockingType` | `'hard' \| 'soft'` | yes | `hard` blocks the movement and the other actions. `soft` blocks only the movement. | | `state` | `ActionState` | yes | | | `allowFailure` | `boolean` | yes | The job continues if this action fails. | | `packageName` | `string \| null` | yes | For `load` and `unload`: the package it handles. | | `bundleName` | `string \| null` | yes | For `load` and `unload`: handles every package of this bundle instead of one package. | | `metadata` | `unknown` | yes | Free-form JSON object, or null. | | `startedAt` | `string (date-time) \| null` | yes | | | `finalizedAt` | `string (date-time) \| null` | yes | | | `duration` | `number` | yes | Estimated duration in milliseconds. | | `createdAt` | `string (date-time)` | yes | | | `updatedAt` | `string (date-time) \| null` | yes | | ### ActionState ### Package | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | | | `name` | `string` | yes | Unique within the job. | | `bundleName` | `string \| null` | yes | Group identifier. | | `description` | `string \| null` | yes | Markdown. | | `pictureURL` | `string \| null` | yes | | | `items` | `{ name: string, quantity: number }[] \| null` | yes | | | `items[].name` | `string` | yes | | | `items[].quantity` | `number` | yes | | | `metadata` | `Record \| null` | yes | | | `station` | `string \| null` | yes | Prep station that owns the package. | | `createdAt` | `string (date-time)` | yes | | ### Hook | Field | Type | Required | Description | | --- | --- | --- | --- | | `jobId` | `string` | yes | | | `name` | `string` | yes | Unique within the job. | | `eventType` | `enum[] \| null` | yes | Fires only for these event types. Null: all. | | `nodeName` | `string[] \| null` | yes | Fires only for these nodes. Null: all. | | `actionName` | `string[] \| null` | yes | Fires only for these actions. Null: all. | | `actionType` | `string[] \| null` | yes | Fires only for these action types. Null: all. | | `packageName` | `string[] \| null` | yes | Fires only for these packages. Null: all. | | `jobState` | `string[] \| null` | yes | Fires only while the job is in one of these states. Null: all. | | `action` | `string` | yes | What the hook does, for example `call_webhook`. | | `target` | `string \| null` | yes | Where the action delivers, for example a URL. | | `queueName` | `string \| null` | yes | Hooks of the same job that share a queue name run one at a time, in event order. Null: they run concurrently. | | `metadata` | `unknown` | yes | Settings for the action, or null. | ### Event | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string (uuid)` | yes | Time-ordered: events sort by `id`. | | `jobId` | `string \| null` | yes | | | `namespace` | `string \| null` | yes | | | `locationId` | `string \| null` | yes | | | `jobVersion` | `number \| null` | yes | The job `version` when the event happened. | | `sequence` | `number` | yes | Orders events that share a timestamp and a job version. | | `jobState` | `string \| null` | yes | | | `botId` | `string \| null` | yes | | | `nodeName` | `string \| null` | yes | | | `actionName` | `string \| null` | yes | | | `packageName` | `string \| null` | yes | | | `eventType` | `enum` | yes | One of `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` | `string` | yes | Where the event happened, as a dotted path. | | `operation` | `string \| null` | yes | The operation that caused it, for example `create_job`. | | `user` | `string \| null` | yes | Who triggered the operation. | | `metadata` | `unknown` | yes | Details of the event. Their shape depends on `eventType`. | | `exportedAt` | `string (date-time) \| null` | yes | Deprecated. Null on current events. | | `createdAt` | `string (date-time)` | yes | | ### Alert | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string (uuid)` | yes | | | `jobId` | `string` | yes | | | `locationId` | `string` | yes | | | `namespace` | `string` | yes | | | `botId` | `string \| null` | yes | | | `jobVersion` | `number` | yes | The job `version` when the alert was raised. | | `name` | `string` | yes | Category of the alert. | | `description` | `string` | yes | Markdown. | | `priority` | `number` | yes | From 0 (lowest) to 100 (highest). | | `eventType` | `enum \| null` | yes | The event that raised the alert, if one did. One of `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`. | | `eventPath` | `string \| null` | yes | | | `eventId` | `string \| null` | yes | | | `eventData` | `unknown` | yes | Data of the event that raised the alert, or null. | | `createdAt` | `string (date-time)` | yes | | | `metadata` | `unknown` | yes | Free-form JSON object, or null. | ### JobOverview | Field | Type | Required | Description | | --- | --- | --- | --- | | `total` | `number` | yes | | | `active` | `number` | yes | Draft, scheduled, pending, in progress and paused. | | `draft` | `number` | yes | | | `scheduled` | `number` | yes | | | `pending` | `number` | yes | | | `in_progress` | `number` | yes | | | `paused` | `number` | yes | | | `completed` | `number` | yes | | | `failed` | `number` | yes | | | `canceled` | `number` | yes | | | `completedLast24h` | `number` | yes | | | `failedLast24h` | `number` | yes | | ### DoorResult | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | `boolean` | yes | True when the door reached the requested state. | | `missionCreated` | `boolean` | yes | Always false from this API. | | `failureReason` | `'stalled' \| 'timeout' \| 'wrong_state' \| 'charging' \| null` | yes | 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` | `string` | yes | The last door state the bot reported. | ### LoadUnloadResult | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | `boolean` | yes | False when the `vri` check failed. The action stays in progress then. | | `doorClosedFailed` | `boolean` | yes | True when the door could not be closed and `allowDoorClosingFailure` let the call go on. | | `botId` | `string` | yes | | | `verificationResult` | `'success' \| 'failed' \| null` | yes | Null when no `verification` was requested. | ### NewNode | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | no | The name of the node. Must be unique per job. Up to 255 characters. | | `description` | `string \| null` | no | A description in markdown format. Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | URL of a picture of the stop. | | `pointId` | `string \| null` | no | A registered point of the job's location. The node takes its coordinates. An unknown point answers `POINT_NOT_FOUND`. | | `lat` | `number \| null` | no | Latitude of the node. -90 to 90. | | `lng` | `number \| null` | no | Longitude of the node. -180 to 180. | | `azimuth` | `number \| null` | no | Azimuth of the node. | | `expendable` | `boolean` | no | Whether the job is expendable in this node. | | `allowFailure` | `boolean` | no | Whether failure of this node is allowed. | | `travelDuration` | `number` | no | Estimated travel time to this node, in milliseconds. | | `released` | `boolean` | no | If false, the node requires manual confirmation to move forward. | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `actions` | `NewAction[]` | no | Actions to run at the node, in order. | ### NewAction | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | The name of the action. Must be unique per node. Up to 255 characters. | | `type` | `string` | yes | What the action does. `load` and `unload` are handled by the engine (see the load and unload routes); other values are free-form. Up to 255 characters. | | `duration` | `number` | no | Estimated time to complete the action, in milliseconds. | | `packageName` | `string \| null` | no | The name of the package associated with the action. | | `bundleName` | `string \| null` | no | The bundle name associated with the action. Up to 255 characters. | | `blockingType` | `'soft' \| 'hard'` | no | `hard` (default) blocks the movement and the other actions. `soft` blocks only the movement. | | `allowFailure` | `boolean` | no | If true, the job continues when this action fails. | | `metadata` | `Record \| null` | no | Metadata and params for the action. | ### NewPackage | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | The name of the package. Must be unique per job. Up to 255 characters. | | `bundleName` | `string \| null` | no | Group identifier for the package. Up to 255 characters. | | `description` | `string \| null` | no | A description in markdown format. Up to 1024 characters. | | `pictureURL` | `string (uri) \| null` | no | URL of a picture of the package. | | `items` | `{ name: string, quantity: number } & Record[] \| null` | no | What is inside. Each item needs `name` and `quantity` (at least 1); other fields are kept. | | `metadata` | `Record \| null` | no | A record of key-value pairs containing additional metadata about the entity. | | `station` | `string \| null` | no | Prep station that owns this package (e.g. "Burger Shop"). Trimmed; blank becomes null. | ### NewHook | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | `string` | yes | The name of the hook. Must be unique per job. Up to 255 characters. | | `eventType` | `enum[] \| null` | no | Fire only for these event types. Omit for all. | | `nodeName` | `string[] \| null` | no | Filter events to specific nodes by their names. | | `actionName` | `string[] \| null` | no | Filter events to specific actions by their names. | | `packageName` | `string[] \| null` | no | Filter events to specific packages by their names. | | `jobState` | `enum[] \| null` | no | Fire only while the job is in one of these states. Omit for all. | | `action` | `'call_webhook'` | no | Only `call_webhook`. Inferred from an `https://` or `http://` `target` when omitted. | | `target` | `string` | no | The URL to call. | | `queueName` | `string \| null` | no | 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. Up to 255 characters. | | `metadata` | `Record \| null` | no | 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). | --- # Pickup display > What kitchen staff see on the pickup display at each state. The pickup display (PDS, the Point Display System) is the screen kitchen staff use at a pickup point: one card per active delivery, updated in real time. You send the create-delivery request, REMI assigns the state, the bot and the timestamps as the delivery runs, and the header color and the button follow the `state` alone. ## Which element comes from which field | Element on the card | Field | Comes from | Notes | | --- | --- | --- | --- | | Order number (`#ES-5867`) | `external_id` | Your request | Your own order id. Falls back to the delivery id when `external_id` is omitted. | | Subtitle (`Corner Kitchen`) | `pickup.name` | Your request | The name of the pickup point you send. | | Customer name (`Alex Rivera`) | `dropoff.contact.name` | Your request | Defaults to "Customer" when absent. | | Item lines (`1x Caesar Salad`) | `packages[].items[]` | Your request | Rendered as `{quantity}x {name}`. Defaults to a single "1x Package" line when no items are sent. | | Header color and status | `state` | REMI | Assigned as the delivery runs. See the table below. | | LOAD / UNLOAD button | `state` | REMI | LOAD appears at `at_pickup`. UNLOAD appears at `at_return`, when a returned order is back at the pickup point. At the customer, the customer unloads, so the pickup display shows no button there. | | Status line | `state` | REMI | Shown instead of a button while waiting for a bot (`pending`) or while it heads to the pickup point (`going_to_pickup`). | | Bot id (`4T001`) | `bot.id` | REMI | Shows "No robot assigned" until one is assigned. | | Time and colored dot | `created_at` | REMI | When the delivery was created, shown as relative time. Hidden during the dropoff leg. | ## What the person sees at each state | `state` | Header color | When it happens | The card shows | | --- | --- | --- | --- | | `pending` | Red | Released, no bot assigned yet. | Status "Waiting for robot assignment" | | `going_to_pickup` | Orange | Bot en route to the pickup point. | Status "Robot is heading to pickup point" | | `at_pickup` | Yellow | Bot arrived at the pickup point. | LOAD button | | `at_return` | Teal | A returned order is back at the pickup point. | UNLOAD button | --- # Tracking page > What your customer sees on the tracker link at each state. The tracking page is what your customer opens from the `tracker_url` returned when a delivery is created. It shows the live state, the ETA and the bot on a map, built from your create-delivery request and from the `state`, bot and ETA that REMI assigns as the delivery runs. ## Which element comes from which field | Element on the page | Field | Comes from | Notes | | --- | --- | --- | --- | | Order number (`#ES-5867`) | `external_id` | Your request | Your own order id. The customer sees their order reference. | | Pickup name (`Corner Kitchen`) | `pickup.name` | Your request | Shown while the bot is heading to pickup. | | Dropoff name (`Maple Residence`) | `dropoff.name` | Your request | Shown once the bot is on the way to the customer. Falls back to "Dropoff" when omitted. | | Package summary | `packages[].items[]` | Your request | Item count in the summary, full list in the package detail sheet. | | Progress bar and status label | `state` | REMI | Assigned as the delivery runs. See the table below. | | ETA badge | `estimates.duration` | REMI | The live route estimate to the current target, shown as "N min". Hidden when there is no ETA. | | Bot id and live position | `bot` | REMI | The bot assigned to the delivery and its position on the map. Shows "-" until one is assigned. | | "Slide to open lid" | `state` | REMI | Appears at `at_dropoff` so the customer can open the lid and collect the order. The customer opens it, not the pickup staff. | ## What the person sees at each state | `state` | Progress | Status label | The customer sees | | --- | --- | --- | --- | | `pending` | 0% | Finding bot | A spinner and "Finding bot". No ETA. | | `going_to_pickup` | 25% | Heading to pickup | The bot en route to the pickup point, with an ETA. | | `at_pickup` | 40% | At pickup | The bot being loaded at the pickup point. | | `going_to_dropoff` | 70% | On the way | A live ETA and the bot moving toward them. The main tracking view. | | `at_dropoff` | 95% | Arrived | A "Slide to open lid" control to collect the order. | | `delivered` | 100% | Delivered | A green "Delivered" and a complete progress bar. |