Post robot task (beta)
const url = 'https://api.example.yas/v1/robots/tasks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partnerId":"partner","schemaVersion":"2026-11","sourceSystem":"partner-export","robotId":"rbt_example","taskInstanceId":"task_1001","taskId":"patrol_12","taskType":"patrol","keywords":["shared_space","night"],"executeStart":"2026-10-15T10:00:00.000Z","timezone":"Asia/Hong_Kong","status":"complete"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.example.yas/v1/robots/tasks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "robotId": "rbt_example", "taskInstanceId": "task_1001", "taskId": "patrol_12", "taskType": "patrol", "keywords": [ "shared_space", "night" ], "executeStart": "2026-10-15T10:00:00.000Z", "timezone": "Asia/Hong_Kong", "status": "complete" }'Beta. Create or replace one task with the server key. Send partnerId, schemaVersion, sourceSystem, robotId, taskInstanceId, executeStart, and timezone. The robot must already exist for this partnerId. An unknown robotId is 404. A later call with the same partnerId, robotId, and taskInstanceId replaces the stored body. Leave an optional field out and it is cleared. Examples for taskType are patrol and charging. Examples for keywords are shared_space, night, and heavy_traffic. Other words are stored. Leave keywords out and it is cleared. An empty list stores no words. updatedAt is ISO-8601 UTC.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Partner id. It must match the server key.
Schema version of this body. Example: 2026-11.
Name of the system that sent this body. Example: partner-export.
Robot id. The robot must already exist.
Id of this run of the task. The same partner, robot, and task instance replaces the stored body.
When the task started, as ISO-8601.
IANA timezone. Example: Asia/Hong_Kong.
Partner task definition id. Example: patrol_12.
What the robot was doing. Examples: patrol, charging.
Words that describe this task. YAS uses them later to group similar tasks. Examples: shared_space, night, heavy_traffic. Other words are stored.
When the task ended, as ISO-8601.
Task status. Any other value is rejected.
Who ended the task: robot, operator, or partner.
True when the robot reached the goal.
Route id.
Mission distance in metres.
Mission length in seconds.
State of charge at the start, as a percent.
State of charge at the end, as a percent.
How many interventions happened during the task.
Why the task was abnormal.
Site id.
True when the task runs in a space shared with people.
How the task ended: complete, interrupted, or aborted.
Firmware version at the time of this call.
Extra fields from the partner. Stored as sent.
object
Example
{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "robotId": "rbt_example", "taskInstanceId": "task_1001", "taskId": "patrol_12", "taskType": "patrol", "keywords": [ "shared_space", "night" ], "executeStart": "2026-10-15T10:00:00.000Z", "timezone": "Asia/Hong_Kong", "status": "complete"}Responses
Section titled “Responses”Task stored. A later call with the same task instance replaces it. updatedAt is ISO-8601 UTC.
object
Example
{ "robotId": "rbt_example", "taskInstanceId": "task_1001", "updatedAt": "2026-10-15T10:45:00.000Z"}400A required field is missing, or `status`, `closer`, or `outcome` is not one of the allowed values.
object
Stable error code. No stack trace.
Example
{ "error": "invalid_body"}401The server key is missing or wrong.
object
Stable error code. No stack trace.
Example
{ "error": "invalid_credentials"}403A server key may be limited to vehicles, robots, or both. A call outside that limit is 403 `forbidden` and stores nothing. `identity_mismatch` means `partnerId` does not match the server key.
object
Stable error code. No stack trace.
Example
{ "error": "forbidden"}404Unknown `robotId`. Nothing in this call is stored.
object
Stable error code. No stack trace.
Example
{ "error": "not_found"}