# GET /campaigns — Get All Campaigns

> Product: **Pabbly Email Marketing** (v2)
> Base URL: `https://emails.pabbly.com/api/v2`
> Auth: Bearer via `Authorization` header
> Canonical: `/email-marketing/campaigns/get-all-campaigns`

Retrieves a paginated list of campaigns for your business. Supports filtering by campaign type (Regular, API / Workflow Campaign, or All). Returns campaigns with template information and pagination metadata.Filter Options: "all" (default): Returns all campaigns regardless of type - includes both Regular campaigns and API / Workflow Campaigns mixed together. Use this when you want to see all your campaigns without any type-based filtering. "Regular": Returns only Regular type campaigns. These are traditional email campaigns created through the dashboard interface using Drag-&-Drop or Rich-Text builders. Regular campaigns are manually created and managed through the UI, and they can have different statuses like draft, scheduled, or live. "API / Workflow Campaign": Returns only API / Workflow Campaign type campaigns. These are campaigns created programmatically via API or integrated with workflows. They typically use HTML builder type, are automatically set to "live" status, and are designed for programmatic use and workflow integrations. Use this filter when you want to manage only API-created campaigns separately from Regular campaigns. Pagination: Default page size is 10 campaigns per page Maximum limit is 100 campaigns per page (automatically capped if exceeded) Page numbers start from 1 Response includes pagination metadata: totalCount, totalPages, hasNextPage, hasPrevPage Response Structure: Each campaign in the response includes complete campaign details (campaignName, senderName, subject, preheaderText), status, associated template information (name, htmlContent, builderType), and timestamps (createdAt, updatedAt). The response also includes pagination object with current page, limit, total count, total pages, and navigation flags. Query Parameters:

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| page | integer | No |  |
| limit | integer | No |  |
| campaignType | string | No |  |

**Response (200)** — Get All Campaigns:

```json
{
    "success": true,
    "status": "success",
    "message": "Campaigns retrieved successfully",
    "data": {
        "campaigns": [
            {
                "_id": "694eddfb5b445a55127ce174",
                "campaignDetails": {
                    "campaignType": "Regular",
                    "campaignName": "ff",
                    "senderName": "fwef",
                    "subject": "ef",
                    "preheaderText": "dbfff"
                },
                "status": "draft",
                "templateId": {
                    "_id": "694eddfb5b445a55127ce172",
                    "name": "sdds Copy",
                    "builderType": "HTML",
                    "htmlContent": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Email Template</title>\n    <style>\n        .email-container {\n            max-width: 600px;\n            margin: 0 auto;\n            font-family: Arial, sans-serif;\n            background-color: #ffffff;\n            color: #333333;\n        }\n        .header {\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            color: white;\n            padding: 30px;\n            text-align: center;\n        }\n        .content {\n            padding: 30px;\n            line-height: 1.6;\n            background-color: #ffffff;\n            color: #333333;\n        }\n        .cta-button {\n            display: inline-block;\n            background-color: #0D68E9;\n            color: white;\n            padding: 15px 30px;\n            text-decoration: none;\n            border-radius: 5px;\n            margin: 20px 0;\n        }\n        .footer {\n            background-color: #f5f5f5;\n            padding: 20px;\n            text-align: center;\n            font-size: 12px;\n            color: #666;\n        }\n        \n        /* Dark mode support */\n        @media (prefers-color-scheme: dark) {\n            .email-container {\n                background-color: #2d2d2d;\n                color: #ffffff;\n            }\n            .content {\n                background-color: #2d2d2d;\n                color: #ffffff;\n            }\n            .footer {\n                background-color: #1a1a1a;\n                color: #cccccc;\n            }\n        }\n    </style>\n</head>\n<body>\n    <div class=\"email-container\">\n        <div class=\"header\">\n            <h1>Welcome to Our Newsletter!</h1>\n            <p>Stay updated with our latest news and offers</p>\n        </div>\n        \n        <div class=\"content\">\n            <h2>Hello there!</h2>\n            <p>Thank you for subscribing to our newsletter. We're excited to share amazing content with you.</p>\n            \n            <a href=\"#\" class=\"cta-button\">Get Started</a>\n            \n            <h3>What you can expect:</h3>\n            <ul>\n                <li>Weekly updates</li>\n                <li>Exclusive offers</li>\n                <li>Industry insights</li>\n                <li>Product announcements</li>\n            </ul>\n        </div>\n        \n        <div class=\"footer\" style=\"background-color: #f5f5f5; padding: 20px; font-size: 12px; color: #666; text-align: center;\">\n          <div style=\"text-align: center;\">\n            <p style=\"margin: 0; display: inline-block;\">This email was sent to {email}</p>\n            <span style=\"margin: 0 5px;\">|</span>\n            <div style=\"display: inline-block;\">\n              <a href=\"#unsubscribe\">Unsubscribe</a>\n              <span>|</span>\n              <a href=\"#view-in-browser\">View in Browser</a>   \n            </div>\n          </div>\n          <p style=\"text-align: center; margin-top: 10px;\">\n            You are receiving this email because you have signed up on our website or subscribed to our email list.\n          </p>\n          <div style=\"text-align: center; margin-top: 10px;\">\n            <img src=\"https://assets-emails.pabbly.com/assets/email-builder/send-with-pabbly-light.png\" alt=\"Google Logo\" width=\"150px\" height=\"20px\"/>\n          </div>\n        </div>\n    </div>\n</body>\n</html>"
                },
                "createdAt": "2025-12-26T19:11:55.131Z",
                "updatedAt": "2025-12-26T19:11:55.131Z"
            }
        ],
        "pagination": {
            "page": 1,
            "limit": 10,
            "totalCount": 1,
            "totalPages": 1,
            "hasNextPage": false,
            "hasPrevPage": false
        }
    }
}
```

**Code examples:**

_cURL_

```curl
curl https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}} \
  -H "Authorization: Bearer {{YOUR_API_KEY}}"
```

_Ruby_

```ruby
require 'net/http'
require 'json'

uri = URI('https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer {{YOUR_API_KEY}}'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(request)
end

data = JSON.parse(response.body)
```

_Python_

```python
import requests

response = requests.get(
    'https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}',
    headers={'Authorization': 'Bearer {{YOUR_API_KEY}}'},
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer {{YOUR_API_KEY}}']);

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
```

_Java_

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
    .uri(URI.create("https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}"))
    .header("Authorization", "Bearer {{YOUR_API_KEY}}")
    .GET();

HttpRequest request = builder.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

_Node.js_

```node
const response = await fetch('https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer {{YOUR_API_KEY}}',
  },
});

const data = await response.json();
```

_Go_

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}", nil)
    req.Header.Set("Authorization", "Bearer {{YOUR_API_KEY}}")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
```

_.NET_

```dotnet
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://emails.pabbly.com/api/v2/campaigns?page={{page}}&limit={{limit}}&campaignType={{campaignType}}");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer {{YOUR_API_KEY}}");

var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
```

---

**Other endpoints in Campaigns:**

- [POST /campaigns — Create Campaign](/email-marketing/campaigns/create-campaign)
- [GET /campaigns/{Campaign ID} — Get Campaign by ID](/email-marketing/campaigns/get-campaign-by-id)
- [POST /campaigns/send-to-individual — Send Campaign to Individual](/email-marketing/campaigns/send-campaign-to-individual)
- [POST /campaigns/send-to-list — Send Campaign to Lists](/email-marketing/campaigns/send-campaign-to-lists)

