Delete Template By Template ID and Element Name

Use this API to delete a template using the templateId and elementName.

📘

Note

This action is irreversible. Once a template has been deleted, it cannot be restored.

❗️

Attention

This guide is no longer maintained from 31st Jan 2025. Please refer the updated one here.


Request Parameters

KeyDescriptionValuesData TypesRequired/OptionalConstraints
AuthorizationAccess Token for the application{PARTNER_APP_TOKEN}StringRequiredShould be a valid Partner App Access Token
appIdApp id of the appbf9ee64c-3d4d-4ac4-xxxx-732e577007c4StringRequired.The Id should be a valid app Id of Gupshup
elementNameelement name for the template to be deleted{ELEMENT_NAME}StringRequired

Sample Request

curl --location --request DELETE 'http://partner.gupshup.io/partner/app/{APP_ID}/template/{ELEMENT_NAME}/{TEMPLATE_ID}' \
--header 'Authorization: {PARTNER_APP_TOKEN}'

Sample Response

{
  "status": "success"
}

Status Codes

Status Code

Response

Comments

Success

200

{ "status": "success" }

Error

400

{ "status":"error", "message":"Invalid App ID" }

The provided appId is not valid.

403

{ "status":"error", "message":"Template ID and template name does not match" }

If template Id and template name does not match

400

{ "status":"error", "message":"Delete Operation is not allowed for sandbox apps" }

App is not live

400

{ "status":"error", "message":"Please Check If App Has been approved" }

App is not approved

400

{ "status":"error", "message":"Template Does not exists." }

No template found for the provided element name.

400

{ "status":"error", "message":"Template Cannot be deleted" }

Not a master template

400

{ "status":"error", "message":"Unable to delete the template, please try after sometime and if issue still exists than contact dev support" }

Error occurred while deleting template.

403

{ "status":"error", "message":"Not App Owner" }

appId provided is not associated with the provided api key.

500

{ "status": "error", "message": "Internal server error. Please try again later and If Issue still persist then contact Gupshup Dev Support" }

For any Internal Error

Language
Click Try It! to start a request and see the response here!