Save Music Config
PUT/api/v1/music/config
save and update music configuration. music_enabled is preserved by the server and not changed by this endpoint.
Request
- application/json
Body
- Array [
- ]
- Array [
- ]
config objectrequired
Full desired files and rules configuration. music_enabled is ignored by the server.
Global music playback switch; update via SetMusicEnabled
files object[]required
Available uploaded music files
GridFS ObjectId string
Display name and exported filename component
Whether this file can be played by matching rules
rules object[]required
Rule list evaluated by priority
Stable unique rule identifier; empty IDs are generated on save
Operator-readable rule name
Disabled rules are ignored
Possible values: [ACTION, AGGREGATED_STATE]
Which incoming signal to match
Possible values: [EQUALS, CONTAINS, STARTS_WITH]
How match_value is compared (case-insensitive)
Value matched against selected source
MusicFile.id to play; ignored when stop_music is true
Gates music_file_id on the robot: the ROS node clears music_file_id on save whenever this is false, regardless of the value sent
Higher number wins on conflict; stable order retained for ties
Possible values: [once, duration, continuous]
Playback behaviour; loop is normalized to continuous
Seconds for duration mode; negative values normalize to 0
Possible values: <= 100
Sound playback volume percent (0–100)
If true, rule stops music and does not require a file
0 = disabled, 1 = tone1, 2 = tone2
Responses
- 200
- 400
- 500
- 503
Music configuration saved successfully
- application/json
- Schema
- Example (from schema)
Schema
data objectrequired
{
"success": true,
"message": "string",
"status": 0,
"data": {
"success": true,
"message": "string"
}
}
Invalid or missing config body
- application/json
- Schema
- Example (from schema)
Schema
{
"success": true,
"message": "string",
"status": 0
}
Internal server error
- application/json
- Schema
- Example (from schema)
Schema
{
"success": true,
"message": "string",
"status": 0
}
ROS instance not available
- application/json
- Schema
- Example (from schema)
Schema
{
"success": true,
"message": "string"
}