Campaigns

Update a message of a campaign

Changed on

Edit a message of a campaign in review, as the app does: only the fields given change. The content of a message is final, so {{variables}} are rejected, apart from {{signature}} and {{unsubscribeLink}}. A body read back ends with <p>{{signature}}</p> when signed: keep it to keep the message's signature as it is, edited or not; a body without it has no signature. {{unsubscribeLink}} links to the unsubscribe page of that message.

A blank subject or body is rejected. A follow-up sent in the same thread takes no subject; a new subject on a message of the first step carries to the follow-ups of its thread. Edits are lost if the campaign goes back to draft, as its messages are generated again on the next review.<br/><Warning>This endpoint is currently in open beta. The API surface may change as we iterate based on feedback.</Warning>

patch/v1/campaigns/{campaignId}/messages/{messageId}

Request

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

Path parameters

campaignIdstring required

The ID of the campaign.

messageIdstring required

The ID of the message.

Headers

Idempotency-Keystring

A unique key, such as a UUID, that makes retrying this request safe: a retry with the same key and body returns the original response without running the operation again. Keys are kept for 24 hours after the request completes.

Example:8e03978e-40d5-43e8-bc93-6894a57f9324

Request body

subjectstring

The subject of the message, in plain text. A follow-up sent in the same thread has the first step's subject, so it takes none. Leave it out to keep the current one.

bodystring

The body of the message, in HTML (or plain text with bodyFormat: "text"). Its content is final: {{variables}} are rejected, apart from {{signature}} and {{unsubscribeLink}}. End it with <p>{{signature}}</p> to keep the message's signature as it is, edited or not; a body without it has no signature. An unsubscribe link, for SendGrid senders only, is <a href="{{unsubscribeLink}}">. Leave it out to keep the current body.

bodyFormat'html' | 'text'

How body is written. html (default) is read as HTML. text is plain text: a blank line starts a new paragraph, each further blank line adds an empty paragraph, a single newline is a line break, and < and & are literal characters. Bodies always read back as HTML.

ccstring[]

Email addresses copied on the message. Leave it out to keep the current ones. At most 5 distinct addresses; duplicates are removed.

bccstring[]

Email addresses blind-copied on the message. Leave it out to keep the current ones. At most 5 distinct addresses; duplicates are removed.

Example request

{
  "subject": "Congrats on the round, Ana",
  "body": "<p>Hi Ana, congrats on the round!</p><p>{{signature}}</p>"
}

Response

The message, as updated.

deprecationsstring[]

Example response

{
  "data": {
    "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
  },
  "deprecations": [
    "This field is deprecated"
  ]
}

Changes