Skip to content

DeleteTemplateById#

The method is intended to delete the existing template by its id.

Request#

To delete an existing template by its id, you need to execute a request to:

POST {{apiUrl}}/waInstance{{idInstance}}/deleteTemplateById/{{apiTokenInstance}}

For idInstance, apiTokenInstance and apiUrl request parameters, refer to Before you start section.

Request parameters#

Parameter Type Mandatory Description
elementName string Yes Template name. The element name is unique to the GREEN-APIs namespace. It can be retrieved using GetTemplateById or GetTemplates method.
templateId string Yes ID of a previously created, existing template. You can use GetTemplates method to find id

Request body example#

{
  "elementName": "ticket_check_url_4245343",
  "templateId": "4967109d-37a9-4de2-be5a-4ded9d7c90d4"
}

Response#

Response parameters#

Parameter Type Description
status string Status of the sent request

Response body example#

Status code success: 200 OK.

{
  "status": "success"
}

DeleteTemplateById errors#

For a list of errors common to all methods, refer to Common errors section.

Request examples#

curl --location '{{apiUrl}}/waInstance{{idInstance}}/deleteTemplate/{{apiTokenInstance}}' \
    --header 'Content-Type: application/json' \
    --data 'elementName=ticket_check_url_4245343' \
    --data 'templateId=4967109d-37a9-4de2-be5a-4ded9d7c90d4'