Campaigns
List campaigns
Returns the organization's campaigns, newest first, optionally filtered by status.
GET
Returns the organization's campaigns, newest first, optionally filtered by status. Each row carries series, the last 14 days of daily email sends the campaign produced, oldest first. Pass nextCursor back as cursor for the next page; it is null on the last page.
apiKeyheader
x-api-key<token>status?stringValue in
"draft""archived"limit?|nullcursor?stringCampaignPage
application/json- response
items*array<>nextCursor*string|nullimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.campaigns.list({});Example Response
{ "items": [ { "id": "string", "name": "string", "channel": "sms", "content": { "channel": "email", "email": { "subject": "string", "html": "string", "text": "string", "attachments": [ { "filename": "string", "content": "string", "mediaId": "string", "contentType": "string", "size": 1 } ], "publicationId": "string", "inputContractId": "string", "templateId": "string", "templateSlug": "string", "templateData": { "property1": "string", "property2": "string" }, "locale": "string", "timeZone": "string", "inReplyToMessageId": "string", "replyTo": [ "string" ], "topicId": "string", "tracking": { "opens": true, "clicks": true }, "footer": { "enabled": true }, "headers": { "property1": "string", "property2": "string" }, "preheader": "string" }, "issue": { "path": "string", "commit": "string" }, "from": { "email": "string", "name": "string" }, "replyMailboxId": "string", "conversationId": "string", "metadata": { "property1": "string", "property2": "string" } }, "audience": { "topicId": "string", "includeTags": [ "string" ], "excludeTags": [ "string" ], "contactIds": [ "string" ], "groupIds": [ "string" ] }, "policy": { "pageSize": 100 }, "definition": { "state": "editable", "frozenAt": "string" }, "latestRun": { "id": "string", "status": "scheduled", "scheduledFor": "string", "completedAt": "string", "totalRecipients": 0, "dispatchedCount": 0, "failedCount": 0, "skippedCount": 0, "pendingCount": 0, "estimatedCompletionAt": "string" }, "createdBy": "string", "actorEmail": "string", "memberRole": "string", "createdAt": "string", "updatedAt": "string", "series": [ 0 ] } ], "nextCursor": "string"}