{
  "info": {
    "_postman_id": "2becafc8-af51-592c-a408-de333d8384fb",
    "name": "Qlara API - Email",
    "description": "The Email section of API Reference in the Qlara documentation.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "id": "0a22aa59-2531-50c6-a1cf-b0e0131a66a7",
      "name": "Send email",
      "request": {
        "name": "Send email",
        "description": {
          "content": "Sends an email to one recipient.\n\n- **Marketing and transactional emails**: set `type`. A marketing email needs the recipient's marketing consent and an unsubscribe link.\n- **Placeholders**: insert `{name}` in the subject or the body and fill the `placeholders` map.\n- **Tracking**: opens and clicks, at the level set in `tracking` and allowed by the recipient's consent.\n- **Scheduling**: set `scheduledDate` to send later.\n- **Dry run**: set `simulation: true` to validate the request without sending.\n- **Consents**: the request reads the recipient's consents on your contacts and records new ones there, creating the contact when needed, also in a dry run. See `consents`.\n\n> **A `202` does not mean the email was accepted.** A request that passes validation is answered `202` also when the email is rejected: check `results.email.accepted` and, if it is `false`, `results.email.reasons`.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "message-server",
            "email",
            "send"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": []
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "POST",
        "auth": null,
        "body": {
          "mode": "raw",
          "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": [
        {
          "id": "f1df835d-7bc9-5fb8-a688-e4ba8f8637e3",
          "name": "Request accepted. Check `results.email.accepted` to see whether the email was accepted.\n\n- **`accepted: true`** means the email was accepted for sending, not that it was delivered: email has no delivery notifications yet.\n- **`reasons`** is present only when the email is rejected.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "message-server",
                "email",
                "send"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Accepted",
          "code": 202,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"messageId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n  \"type\": \"TRANSACTIONAL\",\n  \"simulation\": false,\n  \"results\": {\n    \"email\": {\n      \"accepted\": true,\n      \"tracking\": \"PERSONAL\"\n    }\n  }\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "5dfb9437-9edf-500d-a1c5-c9ee908c8388",
          "name": "Invalid request. Fields that fail validation are listed in `data`, an object that maps the path of each invalid field (such as `sendEmail.request.to`) to its messages (a too long `campaignId` is reported as `sendEmail.request.groupId`); a body that cannot be read, for example a `scheduledDate` in another format or an unknown `type`, gives `data: \"Invalid request body\"`. An error found while handling the email gives `message` and `code` instead: `24` for a `from` or `replyTo` that is not a valid address, or a body with both kinds of unsubscribe marker; `34` for a `body.html` longer than 1,048,576 characters, or with more than 50 distinct links to track; `35` when `consents.marketing` is `false` on a marketing email, which records the opt-out on your contacts.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "message-server",
                "email",
                "send"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"status\": \"fail\",\n  \"data\": {\n    \"sendEmail.request.body.html\": [\n      \"'body.html' can't be blank\"\n    ],\n    \"sendEmail.request.to\": [\n      \"'to' can't be blank\"\n    ]\n  }\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "485ef044-e323-5276-aa3b-055203d019b1",
          "name": "Missing or invalid credentials. The body is empty.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "message-server",
                "email",
                "send"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "text/plain"
            }
          ],
          "body": "",
          "cookie": [],
          "_postman_previewlanguage": "text"
        },
        {
          "id": "95df053a-1b54-5eda-aa03-a49ddc80a7c1",
          "name": "Your account cannot send emails: `code` 36 when it is not enabled for email sending (a new account is not: contact support to enable it), `code` 102 when the platform cannot find it",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "message-server",
                "email",
                "send"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Forbidden",
          "code": 403,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"status\": \"fail\",\n  \"message\": \"Email sending not allowed\",\n  \"code\": 36\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "2184d978-c456-537e-a147-6a175fc6b3d3",
          "name": "Unexpected error while handling the email",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "message-server",
                "email",
                "send"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"status\": \"error\",\n  \"message\": \"Something bad happened. Please try again!\",\n  \"code\": 8\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "e7796653-3a61-534b-ad4b-3b89ab504595",
          "name": "The calling IP address is outside the IP ranges configured for your account",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "message-server",
                "email",
                "send"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TRANSACTIONAL\",\n  \"from\": \"ordini@example.com\",\n  \"to\": \"mario.rossi@example.org\",\n  \"subject\": \"Il tuo ordine #12345 è stato spedito\",\n  \"body\": {\n    \"html\": \"<p>Ciao Mario, il tuo ordine <strong>#12345</strong> è stato spedito.</p><p><a href=\\\"https://www.example.com/ordini/12345\\\">Segui la spedizione</a></p>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Network Authentication Required",
          "code": 511,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"status\": \"error\",\n  \"message\": \"IP address not allowed\",\n  \"code\": 100\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "64a29d1b-e413-570a-a0be-5b94119d3a70",
      "name": "Campaigns",
      "item": [
        {
          "id": "2d0ac7a8-8bd3-5506-a7fa-61e43d8c778e",
          "name": "List the email senders",
          "request": {
            "name": "List the email senders",
            "description": {
              "content": "Lists the senders your account can send email campaigns from.\n\n- **One entry per sender**: a verified domain appears once per From Name, a single verified address once.\n- **Use a `VERIFIED` sender**: pass its `type`, `id` and, for a domain, `fromNameId` as `emailSenderType`, `emailSenderId` and `emailSenderFromNameId` of the campaign.\n- **Adding senders**: senders are added and verified in the Qlara platform, under **Email Marketing › Settings › Addresses**, not through the API.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email",
                "senders"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            }
          },
          "response": [
            {
              "id": "e7ee7682-27f4-5f8c-aa4d-73a41abe592a",
              "name": "The senders of your account, in any verification status.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    "senders"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "[\n  {\n    \"type\": \"DOMAIN\",\n    \"id\": 12,\n    \"fromNameId\": 31,\n    \"from\": \"news@example.com\",\n    \"displayName\": \"Example News\",\n    \"isDefault\": true,\n    \"status\": \"VERIFIED\"\n  },\n  {\n    \"type\": \"DOMAIN\",\n    \"id\": 12,\n    \"fromNameId\": 31,\n    \"from\": \"news@example.com\",\n    \"displayName\": \"Example News\",\n    \"isDefault\": true,\n    \"status\": \"VERIFIED\"\n  }\n]",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "e27ca8bd-6227-5512-a112-9fa9812992b7",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    "senders"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "244bd5cd-5803-5e6d-a30a-760653bf4ec6",
          "name": "Create an email campaign",
          "request": {
            "name": "Create an email campaign",
            "description": {
              "content": "Creates an email campaign as a draft (status `CREATED`). Nothing is sent until you confirm it with `PUT /campaigns/email/{id}/confirm`.\n\n- **Sender**: a `VERIFIED` sender of your account, from `GET /campaigns/email/senders`. For a domain without `emailSenderFromNameId`, its default From Name is used.\n- **Recipients**: `destinationType` 0 sends to the contacts of your `contactListIds`, 1 to the addresses in `destinations`.\n- **Content**: a `subject` and exactly one of `bodyHtml` and `templateId`. Placeholders such as `{firstName}` are replaced with each contact's fields.\n- **Schedule**: an optional `scheduledDate`; without it the campaign is sent as soon as it is confirmed and its checks pass.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"November newsletter\",\n  \"emailSenderId\": 12,\n  \"emailSenderType\": \"DOMAIN\",\n  \"emailSenderFromNameId\": 31,\n  \"destinationType\": 0,\n  \"contactListIds\": [\n    101\n  ],\n  \"subject\": \"What's new in November\",\n  \"bodyHtml\": \"<html><body><p>Hi {firstName}, here is our news.</p><a id=\\\"unsubscribe\\\" href=\\\"#\\\">Unsubscribe</a></body></html>\",\n  \"scheduledDate\": \"2027-04-01 09:00:00.000+0200\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "id": "928be3cc-3cdb-5ec9-ad8a-047735427dea",
              "name": "The created campaign, in status `CREATED`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "POST",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"November newsletter\",\n  \"emailSenderId\": 12,\n  \"emailSenderType\": \"DOMAIN\",\n  \"destinationType\": 0,\n  \"subject\": \"What's new in November\",\n  \"description\": \"string\",\n  \"emailSenderFromNameId\": 31,\n  \"contactListIds\": [\n    101\n  ],\n  \"destinations\": [\n    \"mario.rossi@example.com\"\n  ],\n  \"replyTo\": \"support@example.com\",\n  \"templateId\": 4977,\n  \"templateLocale\": \"it\",\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"promoCode\": \"NOV25\"\n  },\n  \"attachments\": [\n    {\n      \"mediaKey\": \"r\"\n    },\n    {\n      \"mediaKey\": \"9\"\n    }\n  ],\n  \"scheduledDate\": \"2027-04-01 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": 3120,\n  \"companyId\": 6398,\n  \"userId\": 3460,\n  \"name\": \"string\",\n  \"description\": \"string\",\n  \"emailSenderId\": 3603,\n  \"emailSenderType\": \"string\",\n  \"emailSenderFromNameId\": 4434,\n  \"fromAddress\": \"string\",\n  \"friendlyFrom\": \"string\",\n  \"destinationType\": 4482,\n  \"contactListIds\": [\n    8615,\n    3960\n  ],\n  \"destinations\": [\n    \"string\",\n    \"string\"\n  ],\n  \"replyTo\": \"string\",\n  \"subject\": \"string\",\n  \"templateId\": 6114,\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"key_0\": {},\n    \"key_1\": {}\n  },\n  \"attachments\": [\n    {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {}\n    },\n    {\n      \"key_0\": {},\n      \"key_1\": {}\n    }\n  ],\n  \"status\": \"CREATED\",\n  \"contentAnalysis\": [\n    {\n      \"key_0\": {},\n      \"key_1\": {}\n    },\n    {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {}\n    }\n  ],\n  \"totalDestinations\": 6930,\n  \"totalPrice\": 8646,\n  \"totalSent\": 4012,\n  \"totalSuccess\": 7315,\n  \"totalFailed\": 6240,\n  \"totalRead\": 2782,\n  \"totalReadUnique\": 2243,\n  \"totalReadAnonymous\": 2429,\n  \"totalClick\": 5438,\n  \"totalClickUnique\": 9063,\n  \"scheduledDate\": \"string\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\",\n  \"creationDate\": \"string\",\n  \"lastUpdateDate\": \"string\"\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "b223316d-cf6d-5c5b-a416-a7c29d577ce5",
              "name": "The body is not valid: for example both or neither of `bodyHtml` and `templateId`, or a `destinationType` without its recipients.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "POST",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"November newsletter\",\n  \"emailSenderId\": 12,\n  \"emailSenderType\": \"DOMAIN\",\n  \"destinationType\": 0,\n  \"subject\": \"What's new in November\",\n  \"description\": \"string\",\n  \"emailSenderFromNameId\": 31,\n  \"contactListIds\": [\n    101\n  ],\n  \"destinations\": [\n    \"mario.rossi@example.com\"\n  ],\n  \"replyTo\": \"support@example.com\",\n  \"templateId\": 4977,\n  \"templateLocale\": \"it\",\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"promoCode\": \"NOV25\"\n  },\n  \"attachments\": [\n    {\n      \"mediaKey\": \"r\"\n    },\n    {\n      \"mediaKey\": \"9\"\n    }\n  ],\n  \"scheduledDate\": \"2027-04-01 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Bad Request",
              "code": 400,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "23464f71-ac16-52a1-ae92-b3a349d14528",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "POST",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"November newsletter\",\n  \"emailSenderId\": 12,\n  \"emailSenderType\": \"DOMAIN\",\n  \"destinationType\": 0,\n  \"subject\": \"What's new in November\",\n  \"description\": \"string\",\n  \"emailSenderFromNameId\": 31,\n  \"contactListIds\": [\n    101\n  ],\n  \"destinations\": [\n    \"mario.rossi@example.com\"\n  ],\n  \"replyTo\": \"support@example.com\",\n  \"templateId\": 4977,\n  \"templateLocale\": \"it\",\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"promoCode\": \"NOV25\"\n  },\n  \"attachments\": [\n    {\n      \"mediaKey\": \"r\"\n    },\n    {\n      \"mediaKey\": \"9\"\n    }\n  ],\n  \"scheduledDate\": \"2027-04-01 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "079fca5f-7b7f-5a54-ae2f-04c7de1e2cbb",
              "name": "The sender is not a `VERIFIED` sender of your account, or a contact list, template or attachment is not found in your account.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "POST",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"November newsletter\",\n  \"emailSenderId\": 12,\n  \"emailSenderType\": \"DOMAIN\",\n  \"destinationType\": 0,\n  \"subject\": \"What's new in November\",\n  \"description\": \"string\",\n  \"emailSenderFromNameId\": 31,\n  \"contactListIds\": [\n    101\n  ],\n  \"destinations\": [\n    \"mario.rossi@example.com\"\n  ],\n  \"replyTo\": \"support@example.com\",\n  \"templateId\": 4977,\n  \"templateLocale\": \"it\",\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"promoCode\": \"NOV25\"\n  },\n  \"attachments\": [\n    {\n      \"mediaKey\": \"r\"\n    },\n    {\n      \"mediaKey\": \"9\"\n    }\n  ],\n  \"scheduledDate\": \"2027-04-01 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Not Found",
              "code": 404,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "b487cdcf-15d8-52f5-a730-ca5ad1886921",
          "name": "Update an email campaign",
          "request": {
            "name": "Update an email campaign",
            "description": {
              "content": "Changes the fields you send; the others keep their value.\n\n- **When**: while the campaign is a draft (`CREATED`), after its content checks failed (`REJECTED`, `QUARANTINE`), or once confirmed (`PRE_BILLED`) while its `scheduledDate` is still outside the platform's edit window.\n- **Back to draft**: every update sets the status to `CREATED`. A confirmed campaign gets its reserved credit back and must be confirmed again.\n- **Sender and lists** are checked as on creation.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) Email campaign ID."
                }
              ]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"subject\": \"What's new in November (updated)\",\n  \"scheduledDate\": \"2027-04-02 09:00:00.000+0200\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "id": "10833a4d-a152-5eb1-a4dc-fac4c79fb015",
              "name": "The updated campaign, back in status `CREATED`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"subject\": \"What's new in November (updated)\",\n  \"scheduledDate\": \"2027-04-02 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": 3120,\n  \"companyId\": 6398,\n  \"userId\": 3460,\n  \"name\": \"string\",\n  \"description\": \"string\",\n  \"emailSenderId\": 3603,\n  \"emailSenderType\": \"string\",\n  \"emailSenderFromNameId\": 4434,\n  \"fromAddress\": \"string\",\n  \"friendlyFrom\": \"string\",\n  \"destinationType\": 4482,\n  \"contactListIds\": [\n    8615,\n    3960\n  ],\n  \"destinations\": [\n    \"string\",\n    \"string\"\n  ],\n  \"replyTo\": \"string\",\n  \"subject\": \"string\",\n  \"templateId\": 6114,\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"key_0\": {},\n    \"key_1\": {}\n  },\n  \"attachments\": [\n    {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {}\n    },\n    {\n      \"key_0\": {},\n      \"key_1\": {}\n    }\n  ],\n  \"status\": \"CREATED\",\n  \"contentAnalysis\": [\n    {\n      \"key_0\": {},\n      \"key_1\": {}\n    },\n    {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {}\n    }\n  ],\n  \"totalDestinations\": 6930,\n  \"totalPrice\": 8646,\n  \"totalSent\": 4012,\n  \"totalSuccess\": 7315,\n  \"totalFailed\": 6240,\n  \"totalRead\": 2782,\n  \"totalReadUnique\": 2243,\n  \"totalReadAnonymous\": 2429,\n  \"totalClick\": 5438,\n  \"totalClickUnique\": 9063,\n  \"scheduledDate\": \"string\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\",\n  \"creationDate\": \"string\",\n  \"lastUpdateDate\": \"string\"\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "93506e9e-e135-513f-a048-df4607fc099c",
              "name": "The body is not valid, the campaign's status can't be changed, or its `scheduledDate` is inside the edit window.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"subject\": \"What's new in November (updated)\",\n  \"scheduledDate\": \"2027-04-02 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Bad Request",
              "code": 400,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "b88bb580-cdb3-522a-ac8a-ed0c1d4f17e9",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"subject\": \"What's new in November (updated)\",\n  \"scheduledDate\": \"2027-04-02 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "aa92f96c-921c-517d-ac92-eb7e67fe157c",
              "name": "The campaign, the sender, a contact list, the template or an attachment is not found in your account.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"subject\": \"What's new in November (updated)\",\n  \"scheduledDate\": \"2027-04-02 09:00:00.000+0200\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Not Found",
              "code": 404,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "efc1f8e3-d848-505f-a1ab-680ef5177170",
          "name": "Get the price of an email campaign",
          "request": {
            "name": "Get the price of an email campaign",
            "description": {
              "content": "Counts the recipients the campaign has now and prices them. Nothing is reserved: confirming prices the campaign again.\n\n- **`effectiveDestinations`** are the recipients that will receive the email and are charged; `totalPrice` is their price.\n- **`exclusions`** counts the recipients left out: no address, invalid address, no marketing consent, previous hard bounce.\n- **`hasEnoughCredit`** tells whether your wallet covers the price.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email",
                ":id",
                "price"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) Email campaign ID."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            }
          },
          "response": [
            {
              "id": "621cca36-90e4-5759-a4d6-e345172319de",
              "name": "The price preview.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "price"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"totalDestinations\": 7442,\n  \"effectiveDestinations\": 119,\n  \"totalPrice\": 7324,\n  \"availableCredit\": 8950,\n  \"hasEnoughCredit\": true,\n  \"walletKind\": \"string\",\n  \"exclusions\": {\n    \"missingEmail\": 8017,\n    \"invalidEmailFormat\": 9653,\n    \"noMarketingConsent\": 8677,\n    \"hardBounce\": 4279,\n    \"spamRisk\": 2867\n  }\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "8939b07f-73bd-51cf-acfc-a352d4b0d2c6",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "price"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "2f14fa3b-a47f-5956-a9b1-fcd1b28e052e",
              "name": "No email campaign with this ID in your account, or one of its contact lists no longer exists.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "price"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Not Found",
              "code": 404,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "6d81064e-45ad-598d-a360-d06e1d96ee5a",
          "name": "Confirm an email campaign",
          "request": {
            "name": "Confirm an email campaign",
            "description": {
              "content": "Confirms a draft campaign (status `CREATED`): the recipients are counted, the price is reserved on your wallet and the content checks start (status `VALIDATING`).\n\n- **Checks passed**: the campaign moves to `PRE_BILLED` and is sent at its `scheduledDate`, or at once without one. A new sender may first wait for an operator review (`HUMAN_REVIEW`).\n- **Checks failed**: the campaign moves to `REJECTED` or `QUARANTINE`, the credit is released, and you can fix it and confirm it again.\n- **Unsubscribe link**: every email carries one. Pass the `id` of your own link as `unsubscribeLinkId`, otherwise a standard link is added at the end of the email.\n- **Follow the status** with `GET /campaigns/email/{id}`.\n\n> **Preview the price first** with `GET /campaigns/email/{id}/price`: confirming without enough credit answers `402`.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email",
                ":id",
                "confirm"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) Email campaign ID."
                }
              ]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"unsubscribeLinkId\": \"unsubscribe\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "id": "7dbffbd3-0a0a-5955-a914-0d91b43d4b29",
              "name": "Campaign confirmed: the price is reserved and the content checks have started. The body is `{\"status\": \"success\", \"data\": null}`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "confirm"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"unsubscribeLinkId\": \"unsubscribe\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Accepted",
              "code": 202,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "35a1ddee-64e3-5d3b-a112-ebefdb79e9dd",
              "name": "The campaign is not a draft (status `CREATED`).",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "confirm"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"unsubscribeLinkId\": \"unsubscribe\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Bad Request",
              "code": 400,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "4f95bd03-6d85-5187-abd9-d096a879197e",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "confirm"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"unsubscribeLinkId\": \"unsubscribe\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "541c8250-5b47-5682-aadb-d0aff352837c",
              "name": "Your wallet does not cover the price of the campaign.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "confirm"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"unsubscribeLinkId\": \"unsubscribe\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Payment Required",
              "code": 402,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "e63bd535-5de7-5298-a207-7b86495d2031",
              "name": "No email campaign with this ID in your account.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id",
                    "confirm"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "PUT",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"unsubscribeLinkId\": \"unsubscribe\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Not Found",
              "code": 404,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "21f94ec2-4b20-5700-a63e-402834eb16bf",
          "name": "Get an email campaign",
          "request": {
            "name": "Get an email campaign",
            "description": {
              "content": "Returns an email campaign of your account, with its status, content, recipients, price and sending counters.\n\n- **`status`** tells where the campaign is in its lifecycle, from `CREATED` (draft) to `ENDED`.\n- **`contentAnalysis`** holds the results of the content checks, including whether the body has an unsubscribe link.\n- **Counters** (`totalSent`, `totalSuccess`, `totalReadUnique`, `totalClickUnique`, …) grow while the campaign is sent.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) Email campaign ID."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            }
          },
          "response": [
            {
              "id": "e0d285d9-11b7-54f5-a1d7-481abb438557",
              "name": "The email campaign.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": 3120,\n  \"companyId\": 6398,\n  \"userId\": 3460,\n  \"name\": \"string\",\n  \"description\": \"string\",\n  \"emailSenderId\": 3603,\n  \"emailSenderType\": \"string\",\n  \"emailSenderFromNameId\": 4434,\n  \"fromAddress\": \"string\",\n  \"friendlyFrom\": \"string\",\n  \"destinationType\": 4482,\n  \"contactListIds\": [\n    8615,\n    3960\n  ],\n  \"destinations\": [\n    \"string\",\n    \"string\"\n  ],\n  \"replyTo\": \"string\",\n  \"subject\": \"string\",\n  \"templateId\": 6114,\n  \"bodyHtml\": \"string\",\n  \"bodyText\": \"string\",\n  \"placeholderFields\": {\n    \"key_0\": {},\n    \"key_1\": {}\n  },\n  \"attachments\": [\n    {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {}\n    },\n    {\n      \"key_0\": {},\n      \"key_1\": {}\n    }\n  ],\n  \"status\": \"CREATED\",\n  \"contentAnalysis\": [\n    {\n      \"key_0\": {},\n      \"key_1\": {}\n    },\n    {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {}\n    }\n  ],\n  \"totalDestinations\": 6930,\n  \"totalPrice\": 8646,\n  \"totalSent\": 4012,\n  \"totalSuccess\": 7315,\n  \"totalFailed\": 6240,\n  \"totalRead\": 2782,\n  \"totalReadUnique\": 2243,\n  \"totalReadAnonymous\": 2429,\n  \"totalClick\": 5438,\n  \"totalClickUnique\": 9063,\n  \"scheduledDate\": \"string\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\",\n  \"creationDate\": \"string\",\n  \"lastUpdateDate\": \"string\"\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "28c9bd57-2657-55c9-ac0c-653548c80f2b",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "c466ec73-f197-5623-a020-ed4c1290f320",
              "name": "No email campaign with this ID in your account.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Not Found",
              "code": 404,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "fea69eb5-5657-5059-a97d-0add022a070c",
          "name": "List email campaigns",
          "request": {
            "name": "List email campaigns",
            "description": {
              "content": "Lists the email campaigns of your account, one page at a time, newest first by default.\n\n- **Filters**: `status` keeps the given statuses; `search` looks for text in the name, description or subject and then ignores `status`.\n- **Order**: `sortBy` and `sortOrder`, by default `creationDate` descending.\n- **Pages**: `page` starts at 0, `limit` goes from 1 to 100.\n- **Deleted campaigns** are left out. With `search` they are removed after the page is read: a page can then hold fewer campaigns than `limit`, while `totalCount` and `totalPages` still count them.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "disabled": false,
                  "key": "limit",
                  "value": "10",
                  "description": "Campaigns per page, from 1 to 100, default 10."
                },
                {
                  "disabled": false,
                  "key": "page",
                  "value": "0",
                  "description": "Zero-based page number, default 0."
                },
                {
                  "disabled": false,
                  "key": "search",
                  "value": "string",
                  "description": "Text to look for, ignoring case, in the name, description or subject. When set, `status` is ignored."
                },
                {
                  "disabled": false,
                  "key": "sortBy",
                  "value": "creationDate",
                  "description": "Field to sort by: `creationDate` (default), `id`, `name`, `subject`, `status`, `scheduledDate`, `startDate`, `endDate`, `lastUpdateDate`, `effectiveDate` or a counter."
                },
                {
                  "disabled": false,
                  "key": "sortOrder",
                  "value": "desc",
                  "description": "`asc` or `desc` (default)."
                },
                {
                  "disabled": false,
                  "key": "status",
                  "value": "string",
                  "description": "Statuses to keep, comma-separated, e.g. `CREATED,PRE_BILLED`."
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            }
          },
          "response": [
            {
              "id": "eb08d7b1-8f3c-5bff-ae94-aa617eb5fece",
              "name": "One page of email campaigns.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "10"
                    },
                    {
                      "key": "page",
                      "value": "0"
                    },
                    {
                      "key": "search",
                      "value": "string"
                    },
                    {
                      "key": "sortBy",
                      "value": "creationDate"
                    },
                    {
                      "key": "sortOrder",
                      "value": "desc"
                    },
                    {
                      "key": "status",
                      "value": "string"
                    }
                  ],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "48056373-e2d2-57fc-aabe-868ab8cac46a",
              "name": "A `status`, `sortBy`, `sortOrder`, `page` or `limit` that is not valid.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "10"
                    },
                    {
                      "key": "page",
                      "value": "0"
                    },
                    {
                      "key": "search",
                      "value": "string"
                    },
                    {
                      "key": "sortBy",
                      "value": "creationDate"
                    },
                    {
                      "key": "sortOrder",
                      "value": "desc"
                    },
                    {
                      "key": "status",
                      "value": "string"
                    }
                  ],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Bad Request",
              "code": 400,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "8c89f292-d29d-5f8f-aaf5-c0fa76828d7e",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "10"
                    },
                    {
                      "key": "page",
                      "value": "0"
                    },
                    {
                      "key": "search",
                      "value": "string"
                    },
                    {
                      "key": "sortBy",
                      "value": "creationDate"
                    },
                    {
                      "key": "sortOrder",
                      "value": "desc"
                    },
                    {
                      "key": "status",
                      "value": "string"
                    }
                  ],
                  "variable": []
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        },
        {
          "id": "5bccb290-ee43-55de-a5bd-a50ca67d242b",
          "name": "Delete an email campaign",
          "request": {
            "name": "Delete an email campaign",
            "description": {
              "content": "Deletes an email campaign that has not started. This cannot be undone.\n\n- **Not yet confirmed**, or with its checks running or failed: it can always be deleted.\n- **Confirmed** (`PRE_BILLED` or `HUMAN_REVIEW`): only while its `scheduledDate` is still outside the platform's edit window. Deleting it releases the reserved credit.\n- **From `READY` onwards** the campaign is being prepared or sent and can no longer be deleted.",
              "type": "text/plain"
            },
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "campaigns",
                "email",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) Email campaign ID."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "DELETE",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}"
                },
                {
                  "key": "in",
                  "value": "header"
                }
              ]
            }
          },
          "response": [
            {
              "id": "b994677a-fa23-5fc9-a55b-4c68eeaf3aa0",
              "name": "Campaign deleted. The body is `{\"status\": \"success\", \"data\": null}`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "DELETE",
                "body": {}
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "5afd4bc7-eaf1-5ad1-a4f8-f029325ad3e4",
              "name": "The campaign is `READY` or later, or its `scheduledDate` is inside the edit window.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "DELETE",
                "body": {}
              },
              "status": "Bad Request",
              "code": 400,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "a4537d00-c0ea-5a02-ae93-ad940216f217",
              "name": "The API key is missing or invalid, or holds neither `CAMPAIGNS` nor `EMAIL`.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "DELETE",
                "body": {}
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "09ec8f39-c3bc-5bb1-a8aa-4baed53c41db",
              "name": "No email campaign with this ID in your account.",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "partner-gateway",
                    "campaigns",
                    "email",
                    ":id"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "5145",
                      "key": "id",
                      "description": "(Required) Email campaign ID."
                    }
                  ]
                },
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  }
                ],
                "method": "DELETE",
                "body": {}
              },
              "status": "Not Found",
              "code": 404,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "\"\"",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        }
      ]
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.qlara.ai",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "YOUR_API_KEY",
      "type": "string"
    }
  ]
}
