Get a campaign

GET /api/v1/campaigns/{campaignId} The campaign, plus three computed fields:
FieldDescription
recipientCountHow many subscribed contacts the target reaches right now — computed live, never stored
progress{total, sent, failed, pending} of the actual sends
sendingEnabledfalse when mass sending is switched off — nothing will leave, whatever you do
recipientCount counts subscribers only: unsubscribed, bounced and complained contacts are already out. It is the honest answer to "how many people will get this", and it is also how you catch a target that matches nobody before sending.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERAllowed
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Example

bash
curl -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/campaigns/$CAMPAIGN_ID"

Response

  • 200 OK — the call succeeded.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 404 Not Found — no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringUnique identifier for the campaign
data.namestringIts internal name
data.subjectstringThe subject recipients see
data.statusstringdraft, scheduled, sending, sent, failed
data.listIdstringThe list it targets
data.tagIdstringnull
data.segmentIdstringnull
data.scheduledAtstringnull
data.sentAtstringnull
data.createdAtstringISO creation date
data.updatedAtstringISO date of the last change
data.recipientCountnumberHow many subscribers the target hits right now — live, never stored
data.progressobject{total, sent, failed, pending, sending, lastSentAt}
data.sendingEnabledbooleanWhether sending is currently enabled across AgentsMail

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "name": "Newsletter",
    "subject": "August news",
    "status": "subscribed",
    "listId": "0b7c51e8",
    "tagId": "7c2ef4b1",
    "segmentId": "3f81aa2c",
    "scheduledAt": "2026-08-23T10:22:05.000Z",
    "sentAt": "2026-08-23T10:22:05.000Z",
    "createdAt": "2026-08-23T10:22:05.000Z",
    "updatedAt": "2026-08-23T10:22:05.000Z",
    "recipientCount": 12,
    "progress": {
      "total": 1240,
      "sent": 1240,
      "failed": 0,
      "pending": 0,
      "sending": 0,
      "lastSentAt": "2026-08-23T10:31:44.000Z"
    },
    "sendingEnabled": true
  }
}