{
  "openapi": "3.0.1",
  "info": {
    "title": "Music Assistant + Home Assistant Speaker Control",
    "description": "Control your self-hosted Music Assistant server (Spotify, Internet Archive, local library, AirPlay/UPnP/HomePod/Chromecast/Sonos) from anywhere with code. Play tracks/albums/playlists, control volume, queue, shuffle, repeat, multi-room. Self-hosted MA required (free, open source).",
    "version": "0.1",
    "x-build-id": "Qb1v9SCajAQKgoJVN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/adroit_bluebonnet~music-assistant/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-adroit_bluebonnet-music-assistant",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/adroit_bluebonnet~music-assistant/runs": {
      "post": {
        "operationId": "runs-sync-adroit_bluebonnet-music-assistant",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/adroit_bluebonnet~music-assistant/run-sync": {
      "post": {
        "operationId": "run-sync-adroit_bluebonnet-music-assistant",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "server_url",
          "api_token",
          "action",
          "player_name"
        ],
        "properties": {
          "server_url": {
            "title": "Music Assistant Server URL",
            "type": "string",
            "description": "REQUIRED. The URL of YOUR self-hosted Music Assistant server. Example format: http://192.168.1.50:8095 or https://ma.your-domain.com — this is YOUR private server, not a public service. The actor connects directly to it, so the URL must be reachable from where the actor runs (your LAN for local runs, or a public/tunnel URL for cloud runs)."
          },
          "api_token": {
            "title": "API Token",
            "type": "string",
            "description": "REQUIRED. Long-lived API token created in YOUR Music Assistant server (Settings → Users → 'Create token'). Treats as secret by Apify — never shared. If you don't have Music Assistant installed yet, stop here and set it up first (see actor description)."
          },
          "action": {
            "title": "Action",
            "enum": [
              "play",
              "pause",
              "play_pause",
              "next",
              "previous",
              "volume_set",
              "volume_up",
              "volume_down",
              "mute",
              "power",
              "search"
            ],
            "type": "string",
            "description": "What the actor should do on the chosen player.",
            "default": "play"
          },
          "player_name": {
            "title": "Player Name",
            "type": "string",
            "description": "REQUIRED. The name of the speaker/player to control, exactly as shown in YOUR Music Assistant app (e.g. 'Living Room', 'Kitchen', 'Office HomePod'). Matching is case-insensitive substring. To see your players, open your MA app or check Settings → Players. Leave blank → actor fails with a list of available players."
          },
          "search_query": {
            "title": "Search Query",
            "type": "string",
            "description": "What to search for. REQUIRED for action 'play' and 'search'. Example: 'Daft Punk Around the World', 'Artist Name Album Title'. Searches across all your connected providers (Spotify, Internet Archive, local library, radio)."
          },
          "media_type": {
            "title": "Media Type",
            "enum": [
              "track",
              "album",
              "artist",
              "playlist"
            ],
            "type": "string",
            "description": "What kind of media to play from search results.",
            "default": "track"
          },
          "volume": {
            "title": "Volume",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Volume level 0-100. Only used for action='volume_set' or 'power'.",
            "default": 50
          },
          "power_state": {
            "title": "Power State",
            "enum": [
              "true",
              "false"
            ],
            "type": "string",
            "description": "Only used for action='power'.",
            "default": "true"
          },
          "mute_state": {
            "title": "Mute State",
            "enum": [
              "true",
              "false"
            ],
            "type": "string",
            "description": "Only used for action='mute'.",
            "default": "true"
          },
          "dry_run": {
            "title": "Dry Run (recommended first)",
            "type": "boolean",
            "description": "If true, the actor shows what it WOULD do (search results, target player, parsed action) WITHOUT actually changing playback. Strongly recommended for the first run to verify your server_url, token, and player_name are correct before any real action.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}