Skip to contentSkip to navigationSkip to topbar
On this page

Rolling Back a Release using Plugins API


Sometimes, you need to roll-back a Release. For example, maybe you pushed changes to your Flex contact center, found a bug, and now need to return to a previous stable version. The Plugins API makes it simpler and faster to do this.


Fetch The Releases previously Active on Flex

fetch-the-releases-previously-active-on-flex page anchor

Start by retrieving the list of Releases previously active on your account

Read the List of ReleasesLink to code sample: Read the List of Releases
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listPluginRelease() {
11
const pluginReleases = await client.flexApi.v1.pluginReleases.list({
12
limit: 20,
13
});
14
15
pluginReleases.forEach((p) => console.log(p.sid));
16
}
17
18
listPluginRelease();

Output

1
{
2
"releases": [
3
{
4
"sid": "FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"configuration_sid": "FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"date_created": "2020-01-10T20:00:00Z",
8
"url": "https://flex-api.twilio.com/v1/PluginService/Releases/FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}
10
],
11
"meta": {
12
"page": 0,
13
"page_size": 50,
14
"first_page_url": "https://flex-api.twilio.com/v1/PluginService/Releases?PageSize=50&Page=0",
15
"previous_page_url": null,
16
"url": "https://flex-api.twilio.com/v1/PluginService/Releases?PageSize=50&Page=0",
17
"next_page_url": null,
18
"key": "releases"
19
}
20
}

Create a new Release from a prior Configuration

create-a-new-release-from-a-prior-configuration page anchor

From the list of Releases, choose the one that you want to roll-back to. Copy the configuration_sid of that release. You have to create a new Release with the configuration_sid copied in order to make it active on your Flex contact center.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createPluginRelease() {
11
const pluginRelease = await client.flexApi.v1.pluginReleases.create({
12
configurationId: "FJ10000000000000000000000000000000",
13
});
14
15
console.log(pluginRelease.sid);
16
}
17
18
createPluginRelease();

Output

1
{
2
"sid": "FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"configuration_sid": "FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"date_created": "2020-01-10T20:00:00Z",
6
"url": "https://flex-api.twilio.com/v1/PluginService/Releases/FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7
}

You've successfully rolled back your Contact Center to an operational version. Go hunt down that bug, and get ready to cut a new Release with the revised Plugin Code!


Need some help?

Terms of service

Copyright © 2024 Twilio Inc.