`https://lumail.io/api/v1/campaigns/{campaignId}`

Retrieve detailed information about a specific campaign, including its content, sender details, and performance metrics.

## Response

- **Success (200 OK)** - Returns the campaign object with full details.
- **Error (404 Not Found)** - Campaign not found or doesn't belong to your organization.
- **Error (401 Unauthorized)** - Invalid or missing API token.

## Path Parameters

| Parameter    | Type   | Description                          |
| ------------ | ------ | ------------------------------------ |
| `campaignId` | string | **Required.** The unique campaign ID |

## Response Fields

| Field                           | Type           | Description                                      |
| ------------------------------- | -------------- | ------------------------------------------------ |
| `success`                       | boolean        | Indicates if the operation was successful        |
| `campaign`                      | object         | The campaign object with full details            |
| `campaign.id`                   | string         | Unique identifier for the campaign               |
| `campaign.campaignId`           | string         | Same as id (for consistency)                     |
| `campaign.name`                 | string         | Name of the campaign                             |
| `campaign.subject`              | string         | Email subject line                               |
| `campaign.preview`              | string or null | Preview text for the email                       |
| `campaign.status`               | string         | Campaign status: DRAFT, SCHEDULED, SENDING, SENT |
| `campaign.contentType`          | string         | Content type: MAILY, PLATE, or MARKDOWN          |
| `campaign.content`              | object         | Email content in TipTap JSON format              |
| `campaign.replyTo`              | string or null | Reply-to email address                           |
| `campaign.senderId`             | string         | Email sender ID                                  |
| `campaign.scheduledAt`          | string or null | ISO timestamp when the campaign is scheduled     |
| `campaign.sendAt`               | string or null | ISO timestamp when the campaign was sent         |
| `campaign.timezone`             | string         | Timezone for scheduling                          |
| `campaign.recipientCount`       | number         | Number of recipients                             |
| `campaign.recipientFilters`     | array          | Filters applied to select recipients             |
| `campaign.emailsSentCount`      | number         | Number of emails sent                            |
| `campaign.emailsOpenedCount`    | number         | Number of emails opened                          |
| `campaign.emailsClickedCount`   | number         | Number of emails clicked                         |
| `campaign.createdAt`            | string         | ISO timestamp when the campaign was created      |
| `campaign.updatedAt`            | string         | ISO timestamp when the campaign was last updated |
| `campaign.sender`               | object         | Email sender details                             |
| `campaign.sender.id`            | string         | Sender ID                                        |
| `campaign.sender.name`          | string         | Sender name                                      |
| `campaign.sender.displayName`   | string         | Display name shown in emails                     |
| `campaign.sender.localPart`     | string         | Local part of the email address                  |
| `campaign.sender.replyTo`       | string or null | Reply-to address for the sender                  |
| `campaign.sender.domain.domain` | string         | Domain for the sender email                      |
| `campaignId`                    | string         | Campaign ID at the root level for convenience    |

## Usage Example

Use this API endpoint to:

- Retrieve full campaign details for editing
- Display campaign content in your application
- Check campaign status and performance metrics
- Get sender information for a campaign
- Build campaign preview functionality

## Related Documentation

- [List Campaigns](/docs/api-reference/api-campaigns-get) - List all campaigns
- [Create Campaign](/docs/api-reference/api-campaigns-post) - Create a new campaign
- [Update Campaign](/docs/api-reference/api-campaign-patch) - Update a campaign
- [Delete Campaign](/docs/api-reference/api-campaign-delete) - Delete a campaign


## API Reference
**Method:** GET
**Endpoint:** /api/v1/campaigns/{campaignId}

### SDK
```ts
import { Lumail } from "lumail";
const lumail = new Lumail({ apiKey: "YOUR_API_TOKEN" });

const { campaign } = await lumail.campaigns.get("cmp_abc123xyz");
console.log(campaign);
```

### cURL
```bash
curl -X GET https://lumail.io/api/v1/campaigns/cmp_abc123xyz \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

### JavaScript
```javascript
const campaignId = 'cmp_abc123xyz';
const response = await fetch(`https://lumail.io/api/v1/campaigns/${campaignId}`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
});

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

### Python
```python
import requests

campaign_id = "cmp_abc123xyz"
url = f"https://lumail.io/api/v1/campaigns/{campaign_id}"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)
```

### Success Response
```json
{
  "success": true,
  "campaign": {
    "id": "cmp_abc123xyz",
    "campaignId": "cmp_abc123xyz",
    "name": "Welcome Newsletter",
    "subject": "Welcome to our community!",
    "preview": "We're excited to have you...",
    "status": "DRAFT",
    "contentType": "MAILY",
    "content": {
      "type": "doc",
      "content": [...]
    },
    "replyTo": null,
    "senderId": "snd_xyz789abc",
    "scheduledAt": null,
    "sendAt": null,
    "timezone": "Europe/Paris",
    "recipientCount": 1500,
    "recipientFilters": [],
    "emailsSentCount": 0,
    "emailsOpenedCount": 0,
    "emailsClickedCount": 0,
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T14:20:00.000Z",
    "sender": {
      "id": "snd_xyz789abc",
      "name": "Newsletter Sender",
      "displayName": "Acme Inc",
      "localPart": "newsletter",
      "replyTo": null,
      "domain": {
        "domain": "mail.acme.com"
      }
    }
  },
  "campaignId": "cmp_abc123xyz"
}
```

### Error Response
```json
{
  "message": "Campaign not found"
}
```
