Edits a script's name, description, status or code; at least one is required. A
request carrying status changes only the status. Name and description follow the same
rules as import.
Editing source code
A request carrying code has a different outcome for each status:
UNPUBLISHED, with no automation linked to it — the document is replaced in place,
keeping the same script id.PUBLISHED— the next version is created. The response is a new script,
UNPUBLISHED, named after the first version in the chain. The edited script becomes
OUTDATED, keeping its own name and document.OUTDATEDorDEPRECATED— rejected with 409.
The document is validated exactly as on import. The trigger type, parameters and script
dependencies of the script the call returns are derived from it. code and status cannot
be sent in the same request. If the document is rejected, nothing from the request is
applied.
Allowed status changes
PUBLISHED, UNPUBLISHED and DEPRECATED are accepted as a status; OUTDATED and DELETED
cannot be requested. Setting PUBLISHED or UNPUBLISHED to the value the script already
holds succeeds and leaves the script unchanged.
Script dependencies
PUBLISHED also publishes every script it depends on,
recursively, so one call can publish several scripts. UNPUBLISHED is rejected with 409
while a PUBLISHED script depends on this one.
Deprecation
DEPRECATED retires a superseded version for good and is accepted only while the script is OUTDATED. It is refused with 409 while any automation on the version is ACTIVE — the message names them by alias — and on success the version's remaining automations are set to DISABLED.
DEPRECATED is terminal: no status change or code edit is accepted afterwards, and no automation can be created on the version.
History
Every field that actually changes is recorded in the script's history against the current
user.

