---
title: "Claim Sim Run"
method: POST
path: "/api/v1/devices/{device_id}/sim-runs/claim"
tags: ["simulated runs"]
---

# Claim Sim Run

`POST /api/v1/devices/{device_id}/sim-runs/claim`

## Request

- Base URL: `https://api.brumby.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.brumby.com/api/v1/devices/{device_id}/sim-runs/claim`
- Auth: HTTP bearer

## Path parameters

- `device_id` string, required

## Request body

- SimRunClaim: A bench asking for its next run, or for one run by id.
  - `runner_id` string, required
  - `simulator_host` string, nullable
  - `run_id` string, uuid, nullable

## Response `200`

Successful Response

- SimRunClaimResponse: The claimed run, with the mission config composed for it. The config travels with the claim rather than behind a second call: the runner needs exactly the config that was composed for the paddock it was handed, and two calls is two chances for a fence to move between them.
  - `execution_type` 'deployment' | 'hitl' | 'sitl', required
  - `physical_components` string[], required
  - `run` SimRunResponse, required: One cell of a sweep, as FleetOps holds it.
    - `run_id` string, uuid, required
    - `batch_id` string, uuid, nullable, required
    - `ordinal` integer, required
    - `farm_id` string, required
    - `device_id` string, required
    - `world_slug` string, required
    - `paddock` string, nullable, required
    - `autonomy_host` 'bench' | 'jetson'
    - `simulator_host` string, nullable
    - `runner_launch_mode` 'worker' | 'command'
    - `weather` object
    - `mission_config` object, nullable
    - `mission_plan_id` string, uuid, nullable
    - `mission_plan_revision` integer, nullable
    - `claim_token` string, uuid, nullable
    - `lease_expires_at` string, date-time, nullable
    - `cancel_requested` boolean
    - `herd` object, required
    - `dispatch` 'launch' | 'headless', required: How a simulated run reaches an aircraft, and therefore who authorises it. LAUNCH is the ordinary path and the only one that flies anything: the run schedules a mission request exactly as the customer app does, a pilot signs the JSA and presses LAUNCH, and the dock delivers. FleetOps adds nothing to that sequence and skips nothing in it. HEADLESS never asks a dock for anything. The bench composes the same mission config from the same farm and runs it against a stub dock, so there is no clearance to grant, no aircraft to arm and nothing to authorise -- which is why there is no JSA on it. A sweep of two hundred seeds is this one; a run you want a flight record for is the other.
    - `state` 'pending' | 'requested' | 'claimed' | 'running' | 'succeeded' | 'failed' | 'cancelled', required: Where one cell of a sweep has got to. PENDING through FINISHED is the bench's own progress. REQUESTED is where a LAUNCH run waits: its mission request exists and the pilot's queue owns it from there, so FleetOps deliberately stops describing it -- the request's own state is the answer, and a copy here would be a second one.
    - `mission_request_id` string, uuid, nullable, required
    - `simulation_run_id` string, uuid, nullable, required
    - `claimed_by` string, nullable, required
    - `claimed_at` string, date-time, nullable, required
    - `started_at` string, date-time, nullable, required
    - `finished_at` string, date-time, nullable, required
    - `outcome` object, nullable, required
    - `failure` string, nullable, required
    - `created_by` string, required
    - `created_at` string, date-time, required
  - `mission_config` object, required
  - `external_sim` object, nullable

## Other responses

- `204`: Nothing waiting for this bench
- `422`: Validation Error

---

[API](https://skmtc.dev/brumby/apis/brumby-platform-api.md) - [All operations](https://skmtc.dev/brumby/apis/brumby-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brumby/apis/brumby-platform-api/revisions/fe185e20813e?raw)
