Restore a previous version to draft
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/workflow/{workflow_id}/versions/{definition_id}/rollback \
--header 'Authorization: Bearer <token>'import requests
url = "https://agents.labs.bandwidth.com/api/v1/workflow/{workflow_id}/versions/{definition_id}/rollback"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agents.labs.bandwidth.com/api/v1/workflow/{workflow_id}/versions/{definition_id}/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"created_at": "2023-11-07T05:31:56Z",
"id": 123,
"status": "<string>",
"version_number": 123,
"workflow_json": {},
"published_at": "2023-11-07T05:31:56Z",
"template_context_variables": {},
"workflow_configurations": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Agents
Restore a previous version to draft
Replace the draft with a previous version while keeping the published version unchanged.
POST
/
api
/
v1
/
workflow
/
{workflow_id}
/
versions
/
{definition_id}
/
rollback
Restore a previous version to draft
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/workflow/{workflow_id}/versions/{definition_id}/rollback \
--header 'Authorization: Bearer <token>'import requests
url = "https://agents.labs.bandwidth.com/api/v1/workflow/{workflow_id}/versions/{definition_id}/rollback"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agents.labs.bandwidth.com/api/v1/workflow/{workflow_id}/versions/{definition_id}/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"created_at": "2023-11-07T05:31:56Z",
"id": 123,
"status": "<string>",
"version_number": 123,
"workflow_json": {},
"published_at": "2023-11-07T05:31:56Z",
"template_context_variables": {},
"workflow_configurations": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}This overwrites an existing draft. Retrieve any changes you need to keep before restoring a version.
id from List versions as definition_id; it is different from version_number.
The restored version becomes a draft. The published agent remains unchanged until you explicitly publish. A missing agent/version returns 404; selecting the current draft returns 409. Changing the agent’s assistant mode is not supported by rollback.Authorizations
LabsAuthLabsApiKey
Bandwidth Labs OAuth access token. Uses the user's selected workspace; the workspace header is not required. Do not also send an API key. Bearer-only operations may additionally require the Labs super_user role.
Headers
Required with X-BW-LABS-AGENTS-API-KEY: the positive local workspace ID to access. The key owner must be a current member. Missing or invalid IDs return 400; non-member workspaces return 403. Not required for bearer authentication, which uses the user's selected workspace.
Response
Successful Response