`lumail@2.1.0` · [`lumail.campaigns`](/docs/sdk/v2/campaigns)

```typescript
campaigns.get(campaignId: string): Promise<LumailResult<GetCampaignResponse>>
```

One campaign.

## Path Parameters

| Name | Type | Description |
| ------------ | ------ | -------------------------- |
| `campaignId` | string | **Required.** Campaign id. |

## Response Fields

| Field | Type | Description |
| -------------------- | ---------------- | ----------------------------------------------------------------------------- |
| `id` | string | Campaign id. |
| `campaignId` | string | Optional alias of `id`. |
| `name` | string | Internal name. |
| `subject` | string | Subject line. |
| `preview` | string or null | Preview text. |
| `status` | `CampaignStatus` | `DRAFT`, `ARCHIVED`, `SCHEDULED`, `SENDING`, `SENT`, or `FAILED`. |
| `contentType` | `ContentType` | Editor format. |
| `sendAt` | string or null | Actual send time. |
| `scheduledAt` | string or null | Scheduled send time. |
| `recipientCount` | number | Audience size. |
| `emailsSentCount` | number | Sent count. |
| `emailsOpenedCount` | number | Open count. |
| `emailsClickedCount` | number | Click count. |
| `createdAt` | string | Optional ISO 8601 timestamp. |
| `updatedAt` | string | Optional ISO 8601 timestamp. |
| `content` | unknown | Campaign body. |
| `replyTo` | string or null | Reply-To address. |
| `senderId` | string | Sending identity id. |
| `timezone` | string or null | Schedule timezone. |
| `recipientFilters` | unknown[] | Audience filters. |
| `sender` | `CampaignSender` | Sender: `id`, `name`, `displayName`, `localPart`, `replyTo`, `domain.domain`. |

`data` is the campaign. Failures return `{ data: null, error: { name, message, statusCode } }`.


## API Reference
**Method:** GET
**Endpoint:** /api/v2/campaigns/:campaignId

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.campaigns.get("cmp_abc123");
if (error) {
  throw error;
}
console.log(data.subject, data.status);
```

### cURL
```bash
curl https://lumail.io/api/v2/campaigns/cmp_abc123 \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### JavaScript
```javascript
const response = await fetch("https://lumail.io/api/v2/campaigns/cmp_abc123", {
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
});
const data = await response.json();
```

### Success Response
```json
{
  "id": "cmp_abc123",
  "name": "Launch",
  "subject": "Hello",
  "preview": null,
  "status": "DRAFT",
  "contentType": "MAILY",
  "senderId": "snd_abc123",
  "replyTo": null,
  "timezone": null,
  "content": { "type": "doc", "content": [] },
  "recipientFilters": [],
  "sender": {
    "id": "snd_abc123",
    "name": "Hello",
    "displayName": "Hello",
    "localPart": "hello",
    "replyTo": null,
    "domain": { "domain": "yourdomain.com" }
  }
}
```

### Error Response
```json
{
  "name": "not_found",
  "message": "Campaign not found",
  "statusCode": 404
}
```
