Post robot events (beta)
const url = 'https://api.example.yas/v1/robots/events';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partnerId":"partner","schemaVersion":"2026-11","sourceSystem":"partner-export","events":[{"robotId":"rbt_example","eventId":"evt_1001","eventStart":"2026-10-15T10:00:00.000Z","timezone":"Asia/Hong_Kong","type":"mode_change","nativeCode":"100","nativeDescription":"Autonomous moving"}]}'};
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/events \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "events": [ { "robotId": "rbt_example", "eventId": "evt_1001", "eventStart": "2026-10-15T10:00:00.000Z", "timezone": "Asia/Hong_Kong", "type": "mode_change", "nativeCode": "100", "nativeDescription": "Autonomous moving" } ] }'Beta. Post 1 to 500 events with the server key. Each event needs robotId, eventId, eventStart, timezone, type, and nativeCode. type is mode_change, alarm, intervention, navigation, incident, task_state, software_change, or proximity. For a proximity event, send distanceM, objectMotion, and subject when you know them. The robot must already exist for this partnerId. An unknown robotId is 404; nothing in the call is stored. An empty list, a missing field, or an unknown type, objectMotion, subject, resolution, or consequence is 400. More than 500 events is 413. A repeated partnerId, robotId, and eventId keeps the first body. Fields for another type are stored and are not a 400. accepted is new rows. duplicates is rows already stored. eventIds lists every id in order. accepted plus duplicates equals the number of events.
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.
Firmware version at the time of this call.
Extra fields from the partner. Stored as sent.
object
Events in this call. Send 1 to 500.
object
Robot id. The robot must already exist.
Partner event id. The same partner, robot, and event id keeps the first body.
When the episode started, as ISO-8601.
IANA timezone. Example: Asia/Hong_Kong.
Kind of event.
Partner code for this event.
Partner text for nativeCode.
Task instance this event belongs to, when there is one.
Site id.
Zone id inside the site.
When the episode ended, as ISO-8601.
When this body was last updated, as ISO-8601.
Length of the episode in seconds. This is not the response lag.
Partner reason code.
Operating mode before the event.
Operating mode during the event.
Operating mode after the event.
Task status the partner recorded on this event.
Id of the source record in the partner system.
Confidence from 0 to 1.
True when the robot did not identify the episode and a person or system filled the first stored body. A repeat of this event id still keeps that first body.
True when the partner marks this row as a duplicate of another event.
True when a person added detail after the first body was stored.
What the operator did. Examples: take_over, clear_path.
True when a person guided the robot through the episode.
True when the robot was moved by hand or by a remote command.
True when the robot was reset during the episode.
What followed an incident or a near contact.
Obstacle class. Example: cart.
Why the robot stopped. Examples: obstacle, estop.
How many times the robot tried another path.
How the robot recovered. Examples: reroute, wait.
True when there was contact or a near contact.
Incident class. Example: collision.
True when someone was hurt or something was damaged.
Pointer to evidence held by the partner. YAS does not fetch it.
How the episode ended.
Software version after the change.
Why the software changed.
True when this change rolled software back.
True when this change updated a map or a config.
Metres to the object or person. This is not distance travelled.
Whether the object was still or moving.
Whether the nearby thing was a person.
Seconds from detection to the first action. Omit the field when unknown. Do not send null.
Example
{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "events": [ { "robotId": "rbt_example", "eventId": "evt_1001", "eventStart": "2026-10-15T10:00:00.000Z", "timezone": "Asia/Hong_Kong", "type": "mode_change", "nativeCode": "100", "nativeDescription": "Autonomous moving" } ]}Responses
Section titled “Responses”Events stored. accepted is new rows. duplicates is rows already stored for that partner, robot, and event id. eventIds lists every id in order.
object
Example
{ "accepted": 1, "duplicates": 0, "eventIds": [ "evt_1001" ]}400The events list is empty, a required field is missing, or `type`, `objectMotion`, `subject`, `resolution`, or `consequence` 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"}413More than 500 events. Nothing is stored.
object
Stable error code. No stack trace.
Example
{ "error": "payload_too_large"}