Get a campaign

GET /api/v1/campaigns/{campaignId} Returns a campaign with its live recipient count and send progress. recipientCount is computed from the current target; it is not a stored estimate.

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.

Path parameters

ParameterTypeDescription
campaignIdstringUnique identifier of a campaign

Example

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

Response

  • 200 OK — the campaign and its current send information.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 404 Not Found — no such campaign, or it belongs to another organization.
  • 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.namestringInternal campaign name
data.subjectstringSubject shown to recipients
data.contentstringHTML content sent to recipients
data.statusstringdraft, scheduled, sending, sent, failed, or deleted
data.templateIdstring | nullSource template, when the campaign was created from one
data.listIdstringList targeted by the campaign
data.tagIdstring | nullOptional tag narrowing the list
data.sendingIdentityIdstring | nullSelected sender identity; null uses the default identity
data.scheduledAtstring | nullScheduled departure time in ISO 8601 format
data.sentAtstring | nullCompletion time in ISO 8601 format
data.createdAtstringCreation time in ISO 8601 format
data.updatedAtstringLast campaign change in ISO 8601 format
data.recipientCountnumberSubscribed contacts matched by the target right now
data.progress.totalnumberSend records created for the campaign
data.progress.sentnumberMessages confirmed as sent
data.progress.failednumberMessages that ended in failure
data.progress.pendingnumberMessages not yet attempted
data.progress.sendingnumberMessages currently reserved for processing
data.progress.staleSendingnumberReserved messages whose processing window has expired
data.progress.lastActivityAtstring | nullMost recent real send activity: sentAt for a dispatched message, terminal transition time for a failed or skipped message
data.progress.chunkSizenumberNumber of messages assigned to one processing batch
data.sendingEnabledbooleanWhether campaign sending is currently enabled across AgentsMail

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2-75ba-4c3e-a0b2-f8a759282c4d",
    "name": "Newsletter",
    "subject": "August news",
    "content": "<p>Hello {{firstName}}</p>",
    "status": "sending",
    "templateId": null,
    "listId": "0b7c51e8-5df6-4e87-9fc2-d272dca63214",
    "tagId": "7c2ef4b1-94da-46df-b2c4-b390282adf64",
    "sendingIdentityId": null,
    "scheduledAt": "2026-08-23T10:22:05.000Z",
    "sentAt": null,
    "createdAt": "2026-08-23T10:20:05.000Z",
    "updatedAt": "2026-08-23T10:22:05.000Z",
    "recipientCount": 1240,
    "progress": {
      "total": 1240,
      "sent": 1200,
      "failed": 2,
      "pending": 35,
      "sending": 3,
      "staleSending": 1,
      "lastActivityAt": "2026-08-23T10:31:44.000Z",
      "chunkSize": 14
    },
    "sendingEnabled": true
  }
}

Notes

  • staleSending is included in sending; do not add the two values together.
  • Opens and clicks do not refresh lastActivityAt.
  • A non-zero staleSending value does not prove that a message was not accepted. Do not resend it automatically.
  • recipientCount excludes unsubscribed, bounced, and complained contacts.