post
https://partner.gupshup.io/partner/app//template/migrate
- Copies the approved templates of another WABA (for example, your previous BSP's WABA) onto this app's WABA.
- The destination is always the app's own WABA; you pass only the source WABA id.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Which templates are migratedBoth WABAs must belong to the same Meta business. Only templates with status
APPROVEDand qualityGREENorUNKNOWNare migrated.
Long-running callThe call is synchronous and can take up to 180 seconds. Set your client timeout to at least that. It is never retried automatically.
API Request
curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/template/migrate' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'sourceWabaId={{SOURCE_WABA_ID}}'Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appId | String | Yes | Destination app. Its WABA receives the templates. The app must belong to you and have a WABA. |
Request Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Partner App token of the destination app |
Content-Type | Yes | application/x-www-form-urlencoded |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceWabaId | String | Yes | WABA id to migrate the templates from. Must not be blank, must differ from the app's own WABA, and must belong to the same Meta business. |
API Response
{
"migratedCount": 6,
"failedCount": 1,
"status": "success"
}If Meta fails after the first page, the response is still 200 and also carries error:
{
"migratedCount": 200,
"failedCount": 0,
"error": "<Meta error message>",
"status": "success"
}Response Headers
| Header | Value |
|---|---|
Content-Type | application/json |
Response Body
| Parameter | Type | Description |
|---|---|---|
migratedCount | Integer | Number of templates migrated. |
failedCount | Integer | Number of templates Meta could not migrate. |
error | String | Present only when Meta failed after the first page (partial migration). |
status | String | API request status (success). |
Error Responses
| Status | When | Response body |
|---|---|---|
| 400 | sourceWabaId not sent | {"status": "error", "message": "Required request parameter 'sourceWabaId' for method parameter type String is not present"} |
| 400 | sourceWabaId blank or whitespace only | {"status": "error", "message": "sourceWabaId is required"} |
| 400 | The app has no WABA | {"status": "error", "message": "WABA not found for the app"} |
| 400 | sourceWabaId is the app's own WABA | {"status": "error", "message": "Source and destination WABA can not be same"} |
| 400 | Source WABA unknown, or not in the same Meta business | {"status": "error", "message": "Caller is not authorized to access the source WABA."} |
| 401 | Missing or invalid token, or not this app's Partner App token (doesn't count against the rate limit) | {"status": "error", "message": "Unauthorised access to the resource. Please review request parameters and headers and retry"} |
| 405 | Wrong HTTP method (e.g. GET, PUT) | {"status": "error", "message": "Request method 'GET' is not supported"} |
| 415 | Body sent as JSON | {"status": "error", "message": "Content-Type 'application/json' is not supported"} |
| 415 | No Content-Type header | {"status": "error", "message": "Content-Type 'application/octet-stream' is not supported"} |
| 429 | More than 1 authenticated request in 5 minutes for this app | {"status": "error", "message": "Too Many Requests"} |
