Skip to main content

Migrating from Subscriptions v1 to v2

This guide walks you through migrating your existing Subscriptions v1 configurations to the modern Subscriptions v2 platform. Both versions are supported simultaneously, so you can migrate at your own pace without disrupting existing integrations.


Why migrate?

Subscriptions v2 offers several improvements over the legacy v1 platform:

FeatureSubscriptions v1Subscriptions v2
API formatXMLJSON
SecurityBasic authenticationBasic authentication + HMAC payload signing
FilteringOrder ID onlyMultiple fields (order type, event type, order ID, phone number, group, etc.)
Subscription modelPer order typePredefined subscription definitions with flexible filters

Key concept changes

From order types to subscription definitions

In v1, you created one subscription per OrderType (e.g., orders, portins, disconnects). In v2, a subscription definition is a named category of events. A single subscription definition can cover multiple order types, and you use filters to narrow down which events you receive.

The two subscription definitions currently available in v2 are:

v2 Subscription DefinitionCovers
Bandwidth_App_Order_UpdateOrder status changes and notes for all order types (replaces v1 OrderType subscriptions)
Number_Reputation_Management_Monitoring_UpdateNumber reputation monitoring state changes

From XML to JSON

v1 uses an XML request/response body. v2 uses JSON throughout.

From polling-style expiry to persistent subscriptions

v1 required you to set an Expiry in seconds (e.g., 3122064000 for ~99 years). v2 subscriptions do not use a time-based expiry field — subscriptions persist until explicitly deleted.

New: HMAC signature verification

v2 includes an X-Bandwidth-Signature-SHA-256 header on every webhook delivery. You can use this to cryptographically verify that payloads originate from Bandwidth. See HMAC Signature Implementation for details.


Migration steps

Step 1 — Audit your existing v1 subscriptions

Retrieve your current v1 subscriptions:

GET https://api.bandwidth.com/api/accounts/{accountId}/subscriptions HTTP/1.1
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Note each subscription's OrderType or EventType, URL, and any CallbackCredentials. You will recreate these in v2.

Step 2 — Map your v1 order types to v2 subscription definitions

Use the table below to identify which v2 subscription definition covers each of your v1 order type subscriptions.

v1 OrderTypev2 Subscription Definitionv2 filters array element value
ordersBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "orders"}
portinsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "portins"}
portoutsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "portouts"}
disconnectsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "disconnects"}
dldasBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "dldas"}
lsrordersBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "lsrorders"}
e911sBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "e911s"}
tnoptionsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "tnoptions"}
externalTnsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "externalTns"}
lidbBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "lidb"}
bulkPortinsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "bulkPortins"}
importtnordersBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "importtnorders"}
removeImportedTnOrdersBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "removeImportedTnOrders"}
importVoiceTnOrdersBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "importVoiceTnOrders"}
removeImportedVoiceTnOrdersBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "removeImportedVoiceTnOrders"}
csrsBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "csrs"}
emergencyNotificationGroupBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "emergencyNotificationGroup"}
emergencyEndpointGroupBandwidth_App_Order_Update{"field": "orderType", "operator": "EQ", "value": "emergencyEndpointGroup"}

The v1 MESSAGING_LOST event type does not have a direct v2 equivalent at this time. If you rely on MESSAGING_LOST callbacks, keep your v1 subscription in place until a corresponding v2 definition becomes available.

Step 3 — Create equivalent v2 subscriptions

Use the v2 API or the Bandwidth App to recreate each subscription. Refer to the Subscriptions v2 API reference for the full request schema.

The Bandwidth App has a dedicated migration path built in. The subscriptions table shows badges on every row:

  • Deprecated (red) — legacy subscription that has a v2 equivalent available
  • Deprecated (partially migrated) (yellow) — v2 has been created for this recipient, legacy not yet deleted
  • v2 (blue) — already a v2 subscription

The examples below show how to recreate common v1 subscriptions in v2.

v1 — Subscribe to all orders events

POST https://api.bandwidth.com/api/accounts/{accountId}/subscriptions HTTP/1.1
Content-Type: application/xml; charset=utf-8
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

<Subscription>
<OrderType>orders</OrderType>
<CallbackSubscription>
<URL>https://your-domain.com/webhooks/orders</URL>
<Expiry>3122064000</Expiry>
<CallbackCredentials>
<BasicAuthentication>
<Username>username</Username>
<Password>password</Password>
</BasicAuthentication>
</CallbackCredentials>
</CallbackSubscription>
</Subscription>

v2 — Equivalent subscription

POST https://api.bandwidth.com/v2/subscriptions HTTP/1.1
Content-Type: application/json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

{
"accountId": "{accountId}",
"customName": "orders-webhook",
"subscriptionDefinitionName": "Bandwidth_App_Order_Update",
"deliveryType": "WEBHOOK",
"filters": [
{ "field": "orderType", "operator": "EQ", "value": "orders" }
],
"webhookSubscription": {
"url": "https://your-domain.com/webhooks/orders",
"authentication": {
"basicAuthentication": {
"username": "username",
"password": "password"
}
}
}
}

Step 4 — Update your webhook handler for the new payload format

v1 delivers XML payloads. v2 delivers JSON payloads. Update your webhook endpoint to parse JSON instead of XML.

Refer to Order Change Events and Note Events for the full field reference.

v1 example payload (XML)

<?xml version="1.0"?>
<Notification>
<SubscriptionId>c01a23e3-eb99-4174-9598-77d5beadebcf</SubscriptionId>
<OrderType>orders</OrderType>
<OrderId>9cf8daa0-89a4-46aa-a1aa-8b5cf621f218</OrderId>
<Status>COMPLETE</Status>
<Message>Created a new number order for 1 number from RALEIGH, NC</Message>
</Notification>

v2 example payload (JSON)

{
"completedPhoneNumbers": ["+19195555298"],
"lastModifiedDate": "2025-05-05T14:08:26.103Z",
"message": "Created a new number order for 1 number from RALEIGH, NC",
"orderId": "9cf8daa0-89a4-46aa-a1aa-8b5cf621f218",
"orderType": "orders",
"status": "COMPLETE"
}

Step 5 — (Optional) Add HMAC signature verification

v2 includes an X-Bandwidth-Signature-SHA-256 header you can use to verify webhook authenticity. This is strongly recommended before decommissioning v1 subscriptions.

See HMAC Signature Implementation for implementation details and example code.

Step 6 — Validate and decommission v1 subscriptions

Once your v2 subscriptions are confirmed working:

  1. Run both v1 and v2 subscriptions in parallel for a validation period.
  2. Confirm your v2 webhook handler correctly processes all expected event types.
  3. Delete each v1 subscription via the v1 DELETE endpoint:
DELETE https://api.bandwidth.com/api/accounts/{accountId}/subscriptions/{subscriptionId} HTTP/1.1
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
note

If your v1 integration used the PublicKey field (mTLS client certificate verification), note that v2 does not present a client certificate. Remove any mTLS enforcement on your webhook endpoint and use HMAC verification instead.


Summary checklist

  • List all existing v1 subscriptions
  • Map each v1 OrderType to the corresponding v2 subscription definition and filter
  • Create v2 subscriptions via the Subscriptions v2 API or Bandwidth app UI
  • Update webhook handler(s) to parse JSON payloads
  • (Recommended) Implement HMAC signature verification
  • Run v1 and v2 subscriptions in parallel and validate
  • Delete decommissioned v1 subscriptions

Additional resources