Skip to main content
PUT
/
v1
/
scripts
/
{id}
Update a script
curl --request PUT \
  --url http://0.0.0.0:3000/v1/scripts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Apagar luzes da sala",
  "icon": "mdi:lightbulb-off",
  "color": "#9E9E9E",
  "actions": [
    {
      "type": "call_service",
      "entity_id": "light.sala",
      "service": "turn_off"
    }
  ]
}
'
{
  "id": 1,
  "name": "Apagar luzes da sala",
  "icon": "mdi:lightbulb",
  "color": "#FFC107",
  "enabled": true,
  "actions": [
    {
      "type": "call_service",
      "entity_id": "light.sala",
      "service": "turn_on"
    }
  ],
  "user_id": "user_abc123",
  "org_id": null,
  "created_at": "2026-03-17T10:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Organization-Id
string

ID da organização para contexto (opcional). Quando presente, filtra recursos da org.

Path Parameters

id
integer
required

ID numérico do script

Body

application/json
name
string
required

Nome do script

icon
string

Ícone Material

Example:

"mdi:play"

color
string

Cor hex

Example:

"#4CAF50"

actions
object[]

Lista de ações a executar

Response

Script updated

id
integer
name
string
icon
string
color
string
enabled
boolean
actions
object[]
user_id
string
org_id
string | null
created_at
string<date-time>