Skip to main content
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
search-newsletter
Search channels
curl --request POST \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/search-newsletter \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "limit": 123,
  "filters": {
    "countryCodes": [
      {}
    ]
  }
}
'
{
  "id": "<string>",
  "creationTime": 123,
  "state": "<string>",
  "name": "<string>",
  "description": "<string>",
  "subscribersCount": "<string>",
  "inviteLink": "<string>",
  "verification": "<string>",
  "picture": "<string>",
  "preview": "<string>",
  "viewMetadata": {
    "mute": "<string>",
    "role": "<string>"
  }
}

Overview

This method returns a list of channel data, according to the search performed through filters passed in the request body.

Attributes

instanceId
string
required
Your instance ID. Available in the Z-API panel under Instances.
token
string
required
Your Z-API instance token.

Body

limit
number
required
Record limit
filters
object
required
Search filters
view
string
View type (RECOMMENDED, TRENDING, POPULAR or NEW)
searchText
string
Search text

Request Body

{
  "limit": 50,
  "view": "TRENDING",
  "filters": {
    "countryCodes": ["BR", "AF", "CA"]
  },
  "searchText": "Z-API"
}

Response

200

Returns an array of channel objects.
id
string
Channel ID
creationTime
number
Channel creation timestamp
state
string
Channel state (ACTIVE or NON_EXISTING)
name
string
Channel name
description
string
Channel description
subscribersCount
string
Number of channel subscribers
Channel invite link
verification
string
Verification status (VERIFIED or UNVERIFIED)
picture
string
Channel image URL
preview
string
Channel preview image URL
viewMetadata
object
Channel view information
[
  {
    "id": "999999999999999999@newsletter",
    "creationTime": 1695124988,
    "state": "ACTIVE",
    "name": "Channel name",
    "description": "Description",
    "subscribersCount": "150",
    "inviteLink": "https://whatsapp.com/channel/...",
    "verification": "VERIFIED",
    "picture": "https://...",
    "preview": "https://...",
    "viewMetadata": {
      "mute": "OFF",
      "role": "OWNER"
    }
  }
]
The channel ID must always contain the @newsletter suffix, as this is the standard used by WhatsApp.

405

Make sure you are correctly sending the method specification, that is, verify that you sent 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” header to your request, which in most cases is “application/json”.