# GET /campaigns/{Campaign ID} — Get Campaign by ID

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

Retrieves complete details of a specific campaign by its unique ID. Returns campaign information including template details, campaign details, status, and timestamps. Only returns campaigns belonging to your authenticated business. URL Parameters:

**Response (200)** — Get Campaign by ID:

```json
{
    "success": true,
    "status": "success",
    "message": "Campaign fetched successfully",
    "data": {
        "_id": "694eddfb5b445a55127ce174",
        "userId": "682db2da6ef7e93a3eceb126",
        "businessId": "69398c24e90b87748e209d9b",
        "campaignDetails": {
            "campaignType": "Regular",
            "campaignName": "ff",
            "senderName": "fwef",
            "subject": "ef",
            "preheaderText": "dbfff"
        },
        "campaignFolder": "Home",
        "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>"
        },
        "sendDetails": {
            "deliveryServerRouting": false,
            "deliveryServerRoutingConfig": []
        },
        "recipientDetails": {
            "sentToIndividuals": [],
            "autoFollow": false,
            "includedList": [],
            "excludedList": []
        },
        "totalStats": {
            "sent": 0,
            "delivered": 0,
            "failed": 0,
            "queued": 0,
            "opened": 0,
            "uniqueOpens": 0,
            "clicked": 0,
            "unsubscribed": 0,
            "bounced": 0,
            "softBounced": 0,
            "hardBounced": 0
        },
        "linksStats": {
            "clicks": 0
        },
        "totalSubscribers": 0,
        "batchProcessing": {
            "currentListIndex": 0,
            "currentBatchSkip": 0,
            "batchSize": 10000,
            "isInitialized": false,
            "processedSubscribers": 0,
            "allSubscribersQueued": false,
            "totalUniqueEmails": 0,
            "completionRetryCount": 0,
            "validationMismatch": false,
            "forceCompleted": false
        },
        "isDeleted": false,
        "deletedAt": null,
        "permanentDeleteAt": null,
        "countryStats": [],
        "deviceStats": [],
        "osStats": [],
        "createdAt": "2025-12-26T19:11:55.131Z",
        "updatedAt": "2025-12-26T19:11:55.131Z",
        "__v": 0
    }
}
```

**Code examples:**

_cURL_

```curl
curl https://emails.pabbly.com/api/v2/campaigns/{Campaign ID} \
  -H "Authorization: Bearer {{YOUR_API_KEY}}"
```

_Ruby_

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

uri = URI('https://emails.pabbly.com/api/v2/campaigns/{Campaign ID}')
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/{Campaign ID}',
    headers={'Authorization': 'Bearer {{YOUR_API_KEY}}'},
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://emails.pabbly.com/api/v2/campaigns/{Campaign ID}');
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/{Campaign ID}"))
    .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/{Campaign ID}', {
  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/{Campaign ID}", 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/{Campaign ID}");
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 — Get All Campaigns](/email-marketing/campaigns/get-all-campaigns)
- [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)

