> Documentation index: https://nao-rs.lukaloehr.com/llms.txt, a list of every page in this documentation.

# Motion

> REST API: Body motion and head. Generated from the OpenAPI document.

> **Warning:** No motion in this phase
>
> nao-rs doesn't drive the motors yet, and the robot must not move during
> bring-up without a person present. These operations exist and are
> documented for completeness; don't use them on a robot.

## Commanded and executed motion

`GET /v1/motion`

**Token:** required · **Lease:** not needed

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | Commanded and executed motion | [MotionStatus](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#motionstatus) |
| 401 | Missing or wrong token | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |

```bash
curl -H "Authorization: Bearer $TOKEN" http://$ROBOT:7702/v1/motion
```

## Command a motion

`PUT /v1/motion`

What the body does until the next command. Every number is checked (finite, in range) before it reaches the robot; HULKs' fall safety always wins and the death switch cuts all stiffness.

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

**Request body** (`application/json`)

[MotionCommand](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#motioncommand)

| Status | Meaning | Body |
| --- | --- | --- |
| 202 | Commanded | [MotionCommand](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#motioncommand) |
| 409 | Not the active lease | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 422 | Invalid input (out of range, not finite, unknown field) | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 428 | No `Nao-Lease` header | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |

## Steer the head

`PUT /v1/motion/head`

Changes the head of the commanded stand or walk motion, keeping the rest.

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

**Request body** (`application/json`)

[HeadCommand](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#headcommand)

| Status | Meaning | Body |
| --- | --- | --- |
| 202 | The commanded motion with the new head | [MotionCommand](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#motioncommand) |
| 409 | Not the active lease, or the motion has no head control (`no_head_control`) | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 422 | Invalid input | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 428 | No `Nao-Lease` header | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |

## Related topics

- [REST API](https://nao-rs.lukaloehr.com/reference/rest-api.md)
- [System](https://nao-rs.lukaloehr.com/reference/rest-api/system.md)
- [Robot](https://nao-rs.lukaloehr.com/reference/rest-api/robot.md)
- [State](https://nao-rs.lukaloehr.com/reference/rest-api/state.md)
- [Events](https://nao-rs.lukaloehr.com/reference/rest-api/events.md)
- [Safety](https://nao-rs.lukaloehr.com/reference/rest-api/safety.md)
- [Control](https://nao-rs.lukaloehr.com/reference/rest-api/control.md)
- [LEDs](https://nao-rs.lukaloehr.com/reference/rest-api/leds.md)
- [Audio](https://nao-rs.lukaloehr.com/reference/rest-api/audio.md)
- [Cameras](https://nao-rs.lukaloehr.com/reference/rest-api/cameras.md)
- [Power](https://nao-rs.lukaloehr.com/reference/rest-api/power.md)
- [Schemas](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md)
- Previous: [Power](https://nao-rs.lukaloehr.com/reference/rest-api/power.md)
- Next: [Schemas](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md)
