> ## Documentation Index
> Fetch the complete documentation index at: https://zeply.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Export campaign PDF

> Download an executive summary PDF performance report for a campaign

Generate and download a branded, publication-ready PDF report for a campaign. The document contains complete metadata, audience resolution details, broadcast delivery funnel visuals, and an itemized breakdown of sent, delivered, read, and failed messages.

***

### Authentication

This endpoint requires Bearer token authentication.

```http theme={null}
Authorization: Bearer <token>
```

| Header          | Type     | Required | Description                                     | Format           |
| :-------------- | :------- | :------- | :---------------------------------------------- | :--------------- |
| `Authorization` | `string` | **Yes**  | Scoped organization API key or Bearer JWT token | `Bearer <token>` |

***

### Input parameters

<ParamField path="campaign_id" type="string" required>
  Unique UUID identifier of the campaign. Example: `e4a2e584-3672-4d69-b541-6e9f1a238491`.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer <token>`.
</ParamField>

***

### Response Headers

This endpoint returns binary PDF stream data with appropriate content headers:

| Header                | Value                                             | Description                                     |
| :-------------------- | :------------------------------------------------ | :---------------------------------------------- |
| `Content-Type`        | `application/pdf`                                 | MIME type for Portable Document Format.         |
| `Content-Disposition` | `attachment; filename="campaign_report_{id}.pdf"` | Prompts the client or browser to save the file. |

***

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.sayvy.ai/api/v1/campaigns/e4a2e584-3672-4d69-b541-6e9f1a238491/export/pdf" \
    -H "Authorization: Bearer <token>" \
    --output campaign_report.pdf
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.sayvy.ai/api/v1/campaigns/e4a2e584-3672-4d69-b541-6e9f1a238491/export/pdf"

  headers = {
      "Authorization": "Bearer <token>"
  }

  response = requests.get(url, headers=headers)

  if response.status_code == 200:
      with open("campaign_report.pdf", "wb") as f:
          f.write(response.content)
      print("Report saved successfully.")
  else:
      print(response.status_code, response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.sayvy.ai/api/v1/campaigns/e4a2e584-3672-4d69-b541-6e9f1a238491/export/pdf",
    {
      method: "GET",
      headers: {
        "Authorization": "Bearer <token>"
      }
    }
  );

  const blob = await response.blob();
  // In browser environments:
  const downloadUrl = window.URL.createObjectURL(blob);
  const a = document.createElement("a");
  a.href = downloadUrl;
  a.download = "campaign_report.pdf";
  document.body.appendChild(a);
  a.click();
  ```

  ```java Java theme={null}
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.sayvy.ai/api/v1/campaigns/e4a2e584-3672-4d69-b541-6e9f1a238491/export/pdf"))
      .header("Authorization", "Bearer <token>")
      .GET()
      .build();

  HttpResponse<Path> response =
      HttpClient.newHttpClient().send(
          request,
          HttpResponse.BodyHandlers.ofFile(Paths.get("campaign_report.pdf"))
      );
  System.out.println("Downloaded PDF to " + response.body());
  ```
</RequestExample>

<ResponseExample>
  ```http 200 OK theme={null}
  HTTP/1.1 200 OK
  Content-Type: application/pdf
  Content-Disposition: attachment; filename="campaign_report_e4a2e584.pdf"
  Content-Length: 48320

  <binary PDF stream>
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Unauthorized"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "detail": "Campaign not found or does not belong to this organization."
  }
  ```
</ResponseExample>

***

<div
  style={{
display: "flex",
alignItems: "center",
justifyContent: "space-between",
backgroundColor: "rgba(255, 255, 255, 0.03)",
border: "1px solid rgba(255, 255, 255, 0.08)",
borderRadius: "16px",
padding: "10px 18px",
marginTop: "40px",
gap: "16px",
flexWrap: "wrap"
}}
>
  <a
    href="/api-reference/campaigns/delete-campaign"
    style={{
display: "inline-flex",
alignItems: "center",
gap: "6px",
color: "#94A3B8",
textDecoration: "none",
fontSize: "14px",
fontWeight: "500",
padding: "4px 8px"
}}
  >
    <span style={{ fontSize: "16px" }}>‹</span> Previous
  </a>

  <div
    style={{
display: "flex",
alignItems: "center",
gap: "16px",
backgroundColor: "rgba(255, 255, 255, 0.04)",
border: "1px solid rgba(255, 255, 255, 0.06)",
borderRadius: "12px",
padding: "8px 16px",
marginLeft: "auto"
}}
  >
    <div style={{ textAlign: "right" }}>
      <div style={{ fontSize: "13px", fontWeight: "700", color: "#F8FAFC" }}>Campaigns Overview</div>

      <div style={{ fontSize: "11px", color: "#94A3B8", maxWidth: "260px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
        Back to Campaigns documentation hub
      </div>
    </div>

    <div style={{ width: "1px", height: "24px", backgroundColor: "rgba(255, 255, 255, 0.1)" }} />

    <a
      href="/api-reference/campaigns/overview"
      style={{
  display: "inline-flex",
  alignItems: "center",
  gap: "6px",
  color: "#94A3B8",
  textDecoration: "none",
  fontSize: "14px",
  fontWeight: "500"
}}
    >
      Overview <span style={{ fontSize: "16px" }}>›</span>
    </a>
  </div>
</div>
