update

View as MarkdownOpen in Claude

Replace a SWML script resource. Uses PUT for full replacement.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of a SWML Script.

Request

Update Calling ScriptobjectRequired
Request body to update an existing calling SWML Script. All fields are optional — include only what you want to change.
OR
Update Messaging ScriptobjectRequired
Request body to update an existing messaging SWML Script. All fields are optional — include only what you want to change.

Response

idstringRequiredformat: "uuid"
Unique ID of the SWML Script.
project_idstringRequiredformat: "uuid"
Unique ID of the Project.
display_namestringRequired
Display name of the SWML Script Fabric Resource
typeenumRequired
Type of the Fabric Resource
created_atdatetimeRequired
Date and time when the resource was created.
updated_atdatetimeRequired
Date and time when the resource was updated.
swml_scriptobjectRequired
SWML Script data.

Response Example

Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"project_id": "1313fe58-5e14-4c11-bbe7-6fdfa11fe780",
"display_name": "Reply Bot",
"type": "swml_script",
"created_at": "2024-05-06T12:20:00Z",
"updated_at": "2024-05-06T12:25:00Z",
"swml_script": {
"contents": {
"sections": {
"main": [
{
"reply": "Thanks for your message!"
}
]
},
"version": "1.0.0"
},
"display_name": "Reply Bot",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"request_url": "https://example.com/swml_script",
"script_type": "messaging"
}
}

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com",
});
const updated = await client.fabric.swmlScripts.update("resource-id", { display_name: "updated-name" });
console.log(`Updated: ${updated.display_name}`);