ReferenceREST API

Schemas

REST API: every request and response shape. Generated from the OpenAPI document.

AcquireRequest

FieldTypeRequiredMeaning
clientstringyesWho is asking (shown in status and logs), 1 to 64 printable characters. (example joystick-app)
takeoverbooleannoReplace another client's lease. Never replaces a connected brain.

ActiveAnimation

FieldTypeRequiredMeaning
animationLedAnimationyes
groupGroupyes

AnimationKind

Type: breathe, blink, rainbow, progress

AudioInfo

FieldTypeRequiredMeaning
channelsintegeryes
rateintegeryes(example 16000)
sample_formatstringyes(example s16le)
speaker_acceptsarray of stringyesContent types POST /v1/audio/speaker accepts.

Battery

FieldTypeRequiredMeaning
chargenumberyes0..1
chargingbooleanyes
currentnumberyesAmperes; negative while discharging.
temperaturenumberyesDegrees Celsius, whole degrees. (LoLA and HULKs carry a tenth of it: Aldebaran's firmware scales the sensor twice, so 28 °C arrives as 2.8; the API converts it back.)

Board

FieldTypeRequiredMeaning
addressintegeryes
namestringyes(example LeftHipBoard)
versioninteger or nullnoConfiguration version; null if the board did not answer.

CameraInfo

FieldTypeRequiredMeaning
last_image_age_snumber or nullnoSeconds since the last image arrived; null if none yet.
nameCameraNameyes

CameraName

Type: top, bottom

Color

RGB color as "#rrggbb"

Type: string (pattern ^#[0-9a-fA-F]{6}$, example #ff8800)

ControlStatus

FieldTypeRequiredMeaning
clientstring or nullno
controllerstringyesnone, brain (MessagePack client) or lease (a REST client). (example lease)
quiet_for_msinteger or nullnoSince the controller was last heard.
watchdog_activebooleanyesThe watchdog has taken over because the controller went quiet.
yoursbooleanyesTrue if the Nao-Lease header of this request is the active lease.

DeathSwitch

FieldTypeRequiredMeaning
all_off_confirmedboolean or nullnoThe driver confirmed all-off frames since the trip.
availablebooleanyesFalse when the switch page can't be read (e.g. in the simulator).
driverDriver or nullno
generationinteger or nullnoIncrements on every trip and re-arm.
reasonSwitchReason or nullnoWhat tripped it (None while armed).
trippedboolean or nullnoTripped: all motors are off and stay off until re-armed on the robot.
tripped_for_msinteger or nullno
unavailable_reasonstring or nullnoWhy it is not available.

Driver

FieldTypeRequiredMeaning
beat_age_msinteger or nullnoSince the driver's last frame; null if no driver ran since the page was cleared.
cycleintegeryes
pidintegeryes

ErrorBody

The JSON body of every error response.

FieldTypeRequiredMeaning
errorErrorDetailyes

ErrorDetail

FieldTypeRequiredMeaning
codestringyesStable, machine-readable error code (e.g. invalid_input, not_lease_holder). (example invalid_input)
fieldstring or nullnoThe input field at fault, when there is one (dotted path).
messagestringyesWhat went wrong and what to do about it.

Fan

FieldTypeRequiredMeaning
speed_percentintegeryesFan speed, percent.
temperatureintegeryesThe CPU temperature the fan control used, whole °C.

Feet

FieldTypeRequiredMeaning
leftFootyes
rightFootyes

Pressure in kg.

FieldTypeRequiredMeaning
front_leftnumberyes
front_rightnumberyes
rear_leftnumberyes
rear_rightnumberyes

Group

A group in /v1/leds/{group}.

Type: left_eye, right_eye, eyes, left_ear, right_ear, ears, chest, left_foot, right_foot, feet

Hardware

FieldTypeRequiredMeaning
age_msintegeryesHow old these readings are.
boardsarray of BoardyesMotor and foot boards with their configuration versions (empty until the board handshake finished, about 2 s after start).
cpu_temperaturenumber or nullnoThe hottest CPU core in °C (hwmon coretemp; SoC DTS sensors as the fallback); null if the kernel exposes none.
fanFan or nullnoThe head fan's last control round (every 10 s); null before the first.
headHeadReadings or nullnoThe head's power monitor and face board temperature as the head thread decoded them (zeros in the first ~300 ms after start).

HeadCommand

One of these, told apart by type:

center

look_around

look_at: Look at a point on the ground (|x|, |y| <= 10 m).

FieldTypeRequiredMeaning
xnumberyes
ynumberyes

HeadReadings

FieldTypeRequiredMeaning
currentnumberyesAmpere.
powernumberyesWatt.
temperaturenumberyes°C.
voltagenumberyesVolt.

Health

FieldTypeRequiredMeaning
apistringyes(example v1)
state_age_msinteger or nullnoAge of the latest robot state; null before the robot reported one.
statusstringyes(example ok)
uptime_snumberyes

Imu

FieldTypeRequiredMeaning
angular_velocityarray of numberyesrad/s.
linear_accelerationarray of numberyesm/s², x forward, y left, z up.
roll_pitcharray of numberyesRoll and pitch, radians.

Interfaces

FieldTypeRequiredMeaning
msgpack_portintegeryesThe MessagePack-over-TCP API of the brain.
rest_portintegeryesThis API.
udp_stop_portintegeryesThe guard's UDP stop (any datagram starting with the stop magic trips the death switch).

Joint

FieldTypeRequiredMeaning
currentnumberyesAmperes.
namestringyes(example head_yaw)
positionnumberyesRadians (hands: 0 closed .. 1 open).
temperaturenumberyesDegrees Celsius.

LeaseGrant

FieldTypeRequiredMeaning
clientstringyes
heartbeat_interval_msintegeryesSend a heartbeat or command at least this often.
leasestringyesSend this in the Nao-Lease header.
lease_timeout_msintegeryesThe lease ends after this long without a heartbeat or command.

LedAnimation

An animation for one group.

FieldTypeRequiredMeaning
brightnessnumber or nullnoEars: peak brightness 0..1 (default 1). Not for the color groups.
colorColor or nullnoEyes, chest and feet (default white). Not for ears, which are blue only.
kindAnimationKindyes
period_msinteger or nullnoOne cycle, 100 to 60000 ms (default: breathe 3000, blink 1000, rainbow 4000). (100 to 60000)
valuenumber or nullnoProgress only (required there): 0..1.

LedOverrides

Every LED group's override. null (or absent) hands the group back to the robot.

FieldTypeRequiredMeaning
chestColor or nullno
left_eararray of 10 × number or nullno10 brightness levels 0..1 (the ears are blue only).
left_eyearray of 8 × Color or nullno8 colors, index 0 at the top, clockwise as seen from the front.
left_footColor or nullno
right_eararray of 10 × number or nullno
right_eyearray of 8 × Color or nullno
right_footColor or nullno

LedSetting

What to show on a group or a single LED. Exactly one field: eyes take color or colors (8), ears take brightness or levels (10), chest and feet take color; a single LED takes color (eye) or brightness (ear).

FieldTypeRequiredMeaning
brightnessnumber or nullnoOne brightness 0..1 for every ear segment.
colorColor or nullnoOne color for every LED of the group.
colorsarray of 8 × Color or nullnoOne color per eye segment (8).
levelsarray of 10 × number or nullnoOne brightness 0..1 per ear segment (10).

LedStatus

FieldTypeRequiredMeaning
overridesLedOverridesyesThe controller's overrides; null groups show the robot's own status.
shownbooleanyesOverrides show only while a controller (lease or brain) is connected.

MotionCommand

One of these, told apart by type:

stand: Stand still.

FieldTypeRequiredMeaning
headHeadCommandno

walk_to: Walk to a point (|x|, |y| <= 5 m), then stop there. turn_to: final heading relative to the current one (-pi..pi); without it the robot faces where it walked.

FieldTypeRequiredMeaning
headHeadCommandno
speedWalkSpeedno
turn_tonumber or nullno
xnumberyes
ynumberyes

walk_toward: Keep walking toward a point that stays at this offset (|x|, |y| <= 2), like a joystick: (1, 0) straight on, (0.5, 0.5) a circle, (0.02, 0.5) turn on the spot. Send it again to steer, stand to stop.

FieldTypeRequiredMeaning
headHeadCommandno
speedWalkSpeedno
xnumberyes
ynumberyes

sit_down

arms_up

squat

MotionStatus

FieldTypeRequiredMeaning
commandedMotionCommand or nullnoWhat the controller commanded last (null: nothing yet).
executingstring or nullnoWhat the robot executes now (Stand, Walk, SitDown, StandUpFront, ...).

PowerRequest

FieldTypeRequiredMeaning
statePowerStateyes

PowerState

Type: wake, rest

PowerStatus

FieldTypeRequiredMeaning
primary_statestring or nullnoThe robot's primary state from the latest state (Unstiff, Animation, Initial, Playing, Finished); null before the first state.

Preset

FieldTypeRequiredMeaning
descriptionstringyes
namestringyes(example blue)

Queued

FieldTypeRequiredMeaning
duration_msintegeryes
samplesintegeryes

Robot

FieldTypeRequiredMeaning
body_idstringyesBody serial number (empty until the robot runtime reported it).
body_versionstring or nullnoBody hardware version (e.g. 6.0.0); null outside the real robot.
echo_cancellationbooleanyesThe robot removes its own voice from the microphones (echo cancellation), so clients can keep listening while it speaks. False: the robot mutes its microphones while speaking.
head_idstringyesHead serial number (empty until the robot runtime reported it).
head_versionstring or nullnoHead hardware version; null outside the real robot.
interfacesInterfacesyes
simulatedbooleanyesTrue in the simulator (no microphones, speakers or death switch page there).
softwareSoftwareyes

RobotState

FieldTypeRequiredMeaning
age_msintegeryesHow old this state is.
batteryBatteryyes
fall_statestringyesUpright, Falling, Fallen, StandingUp or Sitting.
feetFeetyes
imuImuyes
jointsarray of JointyesEvery joint, head to feet.
motionstringyesThe motion being executed (Stand, Walk, SitDown, ...).
primary_statestringyesUnstiff, Animation, Initial, Playing or Finished.
sonarSonaryes
timenumberyesRobot clock when the state was taken, seconds since the Unix epoch.
touchTouchyes

Safety

FieldTypeRequiredMeaning
death_switchDeathSwitchyes
rearmstringyesHow to re-arm (never possible over the API).

Software

FieldTypeRequiredMeaning
msgpack_protocolintegeryesVersion of the MessagePack protocol on msgpack_port.
namestringyes(example nao-rs)
rest_apistringyes(example v1)
versionstringyesVersion of the robot program.

Sonar

FieldTypeRequiredMeaning
leftnumberyesMeters to the nearest obstacle.
rightnumberyes

StopResult

FieldTypeRequiredMeaning
death_switchDeathSwitchyes
page_trippedbooleanyesThe switch page was tripped directly (reason Api).
udp_sentbooleanyesThe guard's UDP stop was sent too (works even if this program hangs).

StreamEvent

One event on GET /v1/events/stream. The SSE event name is type.

One of these, told apart by type:

touch: A touch sensor was pressed or released.

FieldTypeRequiredMeaning
pressedbooleanyes
sensorstringyes

fall: The fall state changed (Upright, Falling, Fallen, StandingUp, Sitting).

FieldTypeRequiredMeaning
statestringyes

watchdog: The watchdog took over because the controller went quiet, or handed control back.

FieldTypeRequiredMeaning
activebooleanyes

safety: The death switch changed (tripped or re-armed on the robot).

FieldTypeRequiredMeaning
generationintegeryes
reasonSwitchReasonyes
trippedbooleanyes

control: The controller changed.

FieldTypeRequiredMeaning
clientstring or nullno
controllerstringyesnone, brain or lease.

StreamFormat

Type: wav, raw

SwitchReason

Why the death switch was tripped (the drivers' deathswitch::Reason; the first reason wins until re-armed).

ValueMeaning
NoneArmed: not tripped.
ChestButtonThe chest button was pressed.
HeadTouchAll three head touch pads at once.
ApiPOST /v1/safety/stop, the WebSocket stop or the MessagePack Stop (each trips the page directly and also sends the UDP stop).
UdpThe guard's UDP stop alone, e.g. nao-rs stop <address> from the Mac.
Clinaoctl on the robot, or a fresh page (it starts tripped).
DriverFaultThe driver failed (cycle overrun, chest board error) or the runtime stopped.
OvertemperatureToo hot: a joint at 75 °C, or the CPU above 95 °C (the head's fan control).
GuardHeartbeatLostThe guard saw no driver heartbeat and took the chest board over.
GuardNoConfirmationThe driver did not confirm all-off frames after a trip; the guard took over.
TestTests.
PageLostThe page file was truncated, deleted or replaced on disk; it was restored tripped.

Touch

FieldTypeRequiredMeaning
chest_buttonbooleanyes
head_frontbooleanyes
head_middlebooleanyes
head_rearbooleanyes
left_footbooleanyes
left_handbooleanyes
right_footbooleanyes
right_handbooleanyes

VolumeRequest

A volume change. Give percent, muted or both; a percent above 0 also unmutes unless muted is given too.

FieldTypeRequiredMeaning
mutedboolean or nullno
percentinteger or nullno0 to 100. (0 to 100)

VolumeStatus

FieldTypeRequiredMeaning
age_msintegeryesHow old this readback is (the robot reads the mixer about once a second).
mutedbooleanyes
percentintegeryesSpeaker volume 0..100 as the mixer holds it now. (example 65)

WalkSpeed

Type: slow, normal, fast

WsClientMessage

A message from the client. Every message may carry an id, which the answer repeats.

Every field of WsCommand, plus:

FieldTypeRequiredMeaning
idinteger or nullno

WsCommand

One of these, told apart by type:

hello: First message: take the lease for client (1 to 64 printable characters).

FieldTypeRequiredMeaning
clientstringyes
takeoverbooleanno

heartbeat: Keeps control when nothing else is sent (at least every 100 ms).

motion: Like PUT /v1/motion.

FieldTypeRequiredMeaning
motionMotionCommandyes

head: Like PUT /v1/motion/head.

FieldTypeRequiredMeaning
headHeadCommandyes

power: Like PUT /v1/power.

FieldTypeRequiredMeaning
statePowerStateyes

leds: Like PUT /v1/leds/{group}.

FieldTypeRequiredMeaning
groupGroupyes
settingLedSettingyes

volume: Like PUT /v1/audio/volume.

FieldTypeRequiredMeaning
volumeVolumeRequestyes

stop: Like POST /v1/safety/stop: the death switch, needs no lease.

WsServerMessage

A message from the robot.

One of these, told apart by type:

welcome: Answer to hello: you control the robot until the socket closes.

FieldTypeRequiredMeaning
heartbeat_interval_msintegeryes
idinteger or nullno
leasestringyes
lease_timeout_msintegeryes

ok: The command was accepted. motion is the commanded motion after motion and head.

FieldTypeRequiredMeaning
idinteger or nullno
motionMotionCommand or nullno

error: The command was refused (same codes as the HTTP API).

FieldTypeRequiredMeaning
codestringyes
fieldstring or nullno
idinteger or nullno
messagestringyes

stopped: The death switch was tripped.

FieldTypeRequiredMeaning
idinteger or nullno
page_trippedbooleanyes
udp_sentbooleanyes

event: A robot event, as on GET /v1/events/stream.

FieldTypeRequiredMeaning
eventStreamEventyes

On this page