# Retrieve campaign

> GET /campaigns/:id — fetch a single campaign.

`GET /campaigns/:id`

Returns the campaign object for one of your campaigns. Campaigns created via both the API and the dashboard can be retrieved.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The campaign ID. |

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.campaigns.get('8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90');
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

Mailblastr::Campaigns.get("8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90")
```

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

$mailblastr->campaigns->get('8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90');
```

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

mailblastr.Campaigns.get("8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90")
```

**Go**

```go
package main

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

func main() {
    req, _ := http.NewRequest("GET", "https://api.mailblastr.com/campaigns/8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90", nil)
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    out, _ := io.ReadAll(res.Body)
    fmt.Println(string(out))
}
```

**Rust**

```rust
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new()
        .get("https://api.mailblastr.com/campaigns/8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .send()
        .await?;
    println!("{}", res.text().await?);
    Ok(())
}
```

**Java**

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

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mailblastr.com/campaigns/8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

**.NET**

```csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.mailblastr.com/campaigns/8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X GET 'https://api.mailblastr.com/campaigns/8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
mailblastr campaigns get 8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90
```

### Response

**Response fields**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | No | Always `campaign`. |
| `id` | string | No | The campaign ID. |
| `name` | string | null | No | The internal name of the campaign. |
| `audience_id` | string | No | The contact pool the campaign targets — the id of the domain’s per-domain audience. |
| `segment_id` | string | null | No | The segment the campaign is narrowed to, or `null`. |
| `topic_id` | string | null | No | The topic gate, or `null`. |
| `from` | string | null | No | The sender address. |
| `subject` | string | null | No | The subject line. |
| `reply_to` | string | string[] | null | No | The Reply-To address(es), or `null` if unset. |
| `preview_text` | string | null | No | The inbox preview text, or `null` if unset. |
| `html` | string | null | No | The HTML body, or `null` if unset. |
| `text` | string | null | No | The plain-text body, or `null` if unset. |
| `status` | string | No | One of `draft`, `scheduled`, `queued`, `sent`, `failed`, or `recurring`. |
| `scheduled_at` | string | null | No | ISO 8601 send time if scheduled, otherwise `null`. |
| `sent_at` | string | null | No | ISO 8601 time the send began, otherwise `null`. |
| `created_at` | string | No | ISO 8601 creation time. |
| `ab_test` | object | No | A/B test configuration. Always present. `{ enabled: false }` when A/B is not active; when active includes `subject_b`, `test_pct`, `metric`, `status`, and `winner`. |
| `recurrence` | object | null | No | Recurrence config `{ interval, every }` for a recurring campaign, or `null`. |
| `parent_campaign_id` | string | null | No | For a recurring child send, the ID of the template campaign; `null` otherwise. |
| `statistics` | object | No | Aggregate delivery and engagement stats (same shape as `GET /campaigns/:id/stats`). |
| `followups` | array | No | Follow-up sends configured on the campaign — each `{ id, condition, delay, subject, html, status, run_at, sent_count }`. `condition` is one of `opened`, `clicked`, `not_opened`, `not_clicked`, `replied`, `not_replied`; `delay` is a duration like `"5 hours"` or `"4 days"`. Empty array when none. |
| `list_address` | string | null | No | The `List-Unsubscribe` mailbox for this campaign, or `null` to use the account default. |
| `unsubscribe_policy` | string | No | How unsubscribes are scoped: `account` (default), `domain`, or `ignore`. |

```json
{
  "object": "campaign",
  "id": "8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90",
  "name": "June newsletter",
  "audience_id": "aud_3b1c...",
  "segment_id": null,
  "topic_id": null,
  "from": "Acme <news@yourdomain.com>",
  "subject": "What's new in June",
  "reply_to": null,
  "preview_text": "Check out what shipped this month",
  "html": "<p>Hi {{FIRST_NAME}}!</p>",
  "text": "Hi {{FIRST_NAME}}!",
  "status": "sent",
  "scheduled_at": null,
  "sent_at": "2026-06-23T10:20:00.000Z",
  "created_at": "2026-06-23T10:00:00.000Z",
  "ab_test": { "enabled": false },
  "recurrence": null,
  "parent_campaign_id": null,
  "statistics": {}
}
```

> **Note:** Errors: `not_found` if the campaign does not exist or is not yours.
