Campaigns

List the messages of a campaign

Changed on

Retrieve a paginated list of the messages of a campaign, one per recipient and per step, ordered by step. Messages to deleted contacts are listed with recipient.contact: null.<br/><Warning>This endpoint is currently in open beta. The API surface may change as we iterate based on feedback.</Warning>

get/v1/campaigns/{campaignId}/messages

Request

  • Base URL
    https://api.folk.app
  • URL
    https://api.folk.app/v1/campaigns/{campaignId}/messages
  • Auth
    HTTP bearer

Path parameters

campaignIdstring required

The ID of the campaign.

Query parameters

limitinteger

The number of items to return.

cursorstring

A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the pagination.nextLink value returned in a previous response to request subsequent results.

stepinteger

Only list the messages of the step at this position.

recipientIdstring

Only list the messages to this person or company. Messages to deleted contacts match no recipient.

status'draft' | 'sent' | 'not_sent'

Only list the messages with this status. One of: draft, sent, not_sent.

Response

A page of messages of the campaign.

deprecationsstring[]

Example response

{
  "data": {
    "items": [
      {
        "id": "msg_1d2c3b4a-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
        "campaignId": "cmp_9b2f1c1e-2b8a-4d1e-8f5a-3c2d1e0f9a8b",
        "step": 1,
        "recipient": {
          "contact": {
            "id": "per_55175e81-9a52-4ac3-930e-82792c23499b",
            "entityType": "person"
          },
          "name": "John Doe",
          "email": "john.doe@example.com"
        },
        "sender": {
          "id": "snd_4c3b2a19-8f7e-4d6c-9b5a-1e2f3d4c5b6a",
          "email": "john.doe@example.com",
          "displayName": "John Doe"
        },
        "subject": "Quick question, John",
        "body": "<p>Hi John,</p><p>{{signature}}</p>",
        "cc": [],
        "bcc": [],
        "status": "draft",
        "notSentReason": null,
        "unsubscribed": false
      }
    ],
    "pagination": {
      "nextLink": "https://api.folk.app/v1/campaigns/cmp_9b2f1c1e-2b8a-4d1e-8f5a-3c2d1e0f9a8b/messages?limit=20&cursor=eyJvZmZzZXQiOjIwfQ%3D%3D"
    }
  },
  "deprecations": [
    "This field is deprecated"
  ]
}

Changes