Campaigns
List campaigns
const url = 'https://app.whatsetter.com/api/v1/campaigns';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.whatsetter.com/api/v1/campaigns \ --header 'Authorization: Bearer <token>'The workspace’s campaigns: use campaign_id to filter /leads and
/conversations, channels to know where each agent talks
(WhatsApp, Instagram, Messenger) and whatsapp_connected to know
whether its WhatsApp number can currently send. Requires scope
campaigns:read.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The workspace’s campaigns
object
object
The value used by /leads?campaign_id= and lead objects.
The first name the agent signs with (what people call it).
unknown for an internal value outside this list.
setter = 1:1 conversations; group = a WhatsApp group campaign (its participants are left out of /leads unless filtered). unknown for an internal value outside this list.
Where the agent talks: WhatsApp, Instagram (an account answers with it), Messenger (facebook: a Facebook Page answers with it).
Whether its WhatsApp number can send right now (false for an agent that only talks on Instagram or Messenger).
The knowledge base this agent answers from (GET /knowledge-bases/{id}).
Example
{ "data": [ { "status": "active", "purpose": "setter", "channels": [ "whatsapp" ] } ]}Missing, unknown or revoked API key
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}The key lacks the required scope (insufficient_scope), the plan does not have this part of the API (not_in_plan), or Instagram is not enabled on the workspace (instagram_not_enabled, Instagram routes)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}