ReferenceREST API

LEDs

REST API: LED groups, single LEDs, presets. Generated from the OpenAPI document.

All LED overrides

GET /v1/leds

Groups that are null show the robot's own status. The groups and their LEDs are on LEDs.

Token: required · Lease: not needed

StatusMeaningBody
200Current overridesLedStatus
401Missing or wrong tokenErrorBody
curl -H "Authorization: Bearer $TOKEN" http://$ROBOT:7702/v1/leds

Replace all LED overrides

PUT /v1/leds

Groups left out or null go back to the robot.

Token: required · Lease: required (Nao-Lease header)

Request body (application/json)

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
{"chest":"#00ff00","left_ear":[1,1,1,1,1,0,0,0,0,0],"left_foot":"#0050ff","right_foot":"#0050ff"}
StatusMeaningBody
200All overrides replacedLedStatus
409Not the active leaseErrorBody
422Invalid inputErrorBody
428No Nao-Lease headerErrorBody

Hand all LEDs back

DELETE /v1/leds

The robot's own status LEDs return.

Token: required · Lease: required (Nao-Lease header)

StatusMeaningBody
204Every group handed back to the robot
409Not the active leaseErrorBody
428No Nao-Lease headerErrorBody
curl -X DELETE -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" http://$ROBOT:7702/v1/leds

Running LED animations

GET /v1/leds/animations

Token: required · Lease: not needed

StatusMeaningBody
200Animations the ticker is runningarray of ActiveAnimation
401Missing or wrong tokenErrorBody
curl -H "Authorization: Bearer $TOKEN" http://$ROBOT:7702/v1/leds/animations

List LED presets

GET /v1/leds/presets

Token: required · Lease: not needed

StatusMeaningBody
200Available presetsarray of Preset
401Missing or wrong tokenErrorBody
curl -H "Authorization: Bearer $TOKEN" http://$ROBOT:7702/v1/leds/presets

Apply an LED preset

PUT /v1/leds/presets/{name}

Sets every group at once.

Token: required · Lease: required (Nao-Lease header)

ParameterInTypeRequiredMeaning
namepathstringyesPreset name from GET /v1/leds/presets
StatusMeaningBody
200Preset applied to every groupLedStatus
404Unknown presetErrorBody
409Not the active leaseErrorBody
428No Nao-Lease headerErrorBody
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" http://$ROBOT:7702/v1/leds/presets/blue

Set one LED group

PUT /v1/leds/{group}

Eyes take color or colors (8), ears brightness or levels (10), chest and feet color. eyes, ears and feet set both sides.

Token: required · Lease: required (Nao-Lease header)

ParameterInTypeRequiredMeaning
grouppathGroupyesLED group

Request body (application/json)

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).
{"color":"#ff8800"}
StatusMeaningBody
200Group setLedStatus
404Unknown groupErrorBody
409Not the active leaseErrorBody
422Invalid input (e.g. a color for an ear)ErrorBody
428No Nao-Lease headerErrorBody
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" -H 'Content-Type: application/json' \
  -d '{"color": "#0055ff"}' http://$ROBOT:7702/v1/leds/eyes

Hand one LED group back

DELETE /v1/leds/{group}

Token: required · Lease: required (Nao-Lease header)

ParameterInTypeRequiredMeaning
grouppathGroupyesLED group
StatusMeaningBody
200Group handed back to the robotLedStatus
404Unknown groupErrorBody
409Not the active leaseErrorBody
428No Nao-Lease headerErrorBody
curl -X DELETE -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" http://$ROBOT:7702/v1/leds/eyes

Animate an LED group

PUT /v1/leds/{group}/animation

Breathe, blink, rainbow (not ears) or progress, computed on the robot at 20 Hz. Replaces an animation on an overlapping group. Any LED write to the group cancels it, and it ends with the lease. Animation frames are no heartbeat: keep sending heartbeats.

Token: required · Lease: required (Nao-Lease header)

ParameterInTypeRequiredMeaning
grouppathGroupyesLED group

Request body (application/json)

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.
{"color":"#0050ff","kind":"breathe","period_ms":3000}
StatusMeaningBody
200Animation runningarray of ActiveAnimation
404Unknown groupErrorBody
409Not the active leaseErrorBody
422Invalid input (e.g. a rainbow on the ears)ErrorBody
428No Nao-Lease headerErrorBody
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" -H 'Content-Type: application/json' \
  -d '{"kind": "breathe", "color": "#0050ff", "period_ms": 3000}' http://$ROBOT:7702/v1/leds/eyes/animation

Stop an LED animation

DELETE /v1/leds/{group}/animation

The group keeps its last frame; DELETE /v1/leds/{group} hands it back to the robot.

Token: required · Lease: required (Nao-Lease header)

ParameterInTypeRequiredMeaning
grouppathGroupyesLED group
StatusMeaningBody
200Animations still runningarray of ActiveAnimation
404Unknown groupErrorBody
409Not the active leaseErrorBody
428No Nao-Lease headerErrorBody
curl -X DELETE -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" http://$ROBOT:7702/v1/leds/eyes/animation

Set a single LED

PUT /v1/leds/{group}/{index}

One eye segment (color, index 0 to 7 from the top, clockwise as seen from the front) or one ear segment (brightness, index 0 to 9). The index order is on LEDs.

Token: required · Lease: required (Nao-Lease header)

ParameterInTypeRequiredMeaning
grouppathGroupyesleft_eye, right_eye, left_ear or right_ear
indexpathintegeryesSegment: eyes 0..7 from the top clockwise, ears 0..9

Request body (application/json)

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).
{"color":"#ff8800"}
StatusMeaningBody
200Segment setLedStatus
404Unknown groupErrorBody
409Not the active leaseErrorBody
422Invalid input (index out of range, wrong kind of value)ErrorBody
428No Nao-Lease headerErrorBody
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "Nao-Lease: $LEASE" -H 'Content-Type: application/json' \
  -d '{"color": "#ff0000"}' http://$ROBOT:7702/v1/leds/left_eye/0

On this page