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
dataobjectCampaign object.
data.campaignUrlstring | nullCampaign page.
data.campaignEditorUrlstring | nullContent editor for an editable draft.
data.campaignStatsUrlstring | nullStatistics for a sent campaign.
data.campaignPreviewUrlstring | nullInternal preview of a sent campaign.
data.publicCampaignUrlstring | nullShareable archive for a sent campaign with public archives enabled.
data.idstringUnique identifier for the campaign
data.namestringInternal campaign name
data.subjectstringSubject shown to recipients
data.previewTextstring | nullSaved preview text; equal to data.preheader
data.preheaderstring | nullPreview text shown after the subject; null when there is none
data.contentstringHTML content sent to recipients
data.statusstringdraft, scheduled, paused, 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.topicIdstring | nullEditorial topic this campaign carries, if any
data.sendingIdentityIdstring | nullSelected sender identity; null uses the default identity
data.scheduledAtstring | nullScheduled departure time in ISO 8601 format; retained while paused
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
All five links are absolute URLs in the organization’s language (en by default). Unavailable links are null; all are null when the organization has no URL slug. Internal links require sign-in and appropriate organization access; only publicCampaignUrl is public. API and MCP agents should display relevant non-null URLs as clickable Markdown links, for example [Open campaign](campaignUrl) using the returned URL. Creating or reading a campaign does not publish it.

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2-75ba-4c3e-a0b2-f8a759282c4d",
    "name": "Newsletter",
    "subject": "August news",
    "previewText": "Three new things this month",
    "preheader": "Three new things this month",
    "content": "<p>Hello {{firstName}}</p>",
    "status": "sending",
    "templateId": null,
    "listId": "0b7c51e8-5df6-4e87-9fc2-d272dca63214",
    "tagId": "7c2ef4b1-94da-46df-b2c4-b390282adf64",
    "topicId": null,
    "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,
    "campaignUrl": "https://www.agentsmail.io/en/team/my-team/campaigns/4d19c0a2-75ba-4c3e-a0b2-f8a759282c4d",
    "campaignEditorUrl": null,
    "campaignStatsUrl": null,
    "campaignPreviewUrl": null,
    "publicCampaignUrl": null
  }
}

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.