Skip to main content

Creating Newsletter

Method#

/create-newsletter#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/create-newsletter

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method is responsible for creating a newsletter. Unfortunately, it's not possible to create the channel with an image, but you can use the update-newsletter-picture method right after creation, which is in the same section.

Attributes#

Required#

AttributesTypeDescription
namestringNewsletter name

Optional#

AttributesTypeDescription
descriptionstringNewsletter description

Request Body#

Method

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/create-newsletter

Example

{
"name": "Newsletter Name",
"description": "Newsletter Description"
}

Response#

201#

AttributesTypeDescription
idstringNewsletter ID

Example

{
"id": "999999999999999999@newsletter"
}
tip

The returned ID will always include the "@newsletter" suffix, which is the standard used by WhatsApp itself. It should be used in the same format in requests that require the ID as a parameter.

405#

In this case, ensure that you are correctly sending the method specification, i.e., check if you sent the POST or GET as specified at the beginning of this topic.

415#

If you receive a 415 error, make sure to add the "Content-Type" to the headers of the request for the object you are sending, mostly "application/json."


Webhook Response#

Link to the webhook response (upon receiving)

Webhook


Code#