# List campaigns

> GET /campaigns — list your campaigns, newest first.

`GET /campaigns`

Returns your campaigns ordered by creation time (newest first), wrapped in a list object. The `limit` parameter is optional — if you omit it, up to 1,000 campaigns are returned in one response, with `has_more` set to `true` when more exist beyond that ceiling. Page through the remainder with `after`.

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | No | Number of campaigns to retrieve. Minimum `1`, maximum `100`. |
| `after` | string | No | The ID after which to retrieve more campaigns (pagination). The ID itself is excluded. Cannot be combined with `before`. |
| `before` | string | No | The ID before which to retrieve more campaigns (pagination). The ID itself is excluded. Cannot be combined with `after`. |

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.campaigns.list();
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Campaigns.list
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendDart\SendDart;

$senddart = SendDart::client('mb_xxxxxxxxx');

$senddart->campaigns->list();
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Campaigns.list()
```

**Go**

```go
import "github.com/shekhu10/senddart-sdks/senddart-go"

client := senddart.NewClient("mb_xxxxxxxxx")

campaigns, err := client.Campaigns.List(nil)
```

**Rust**

```rust
use senddart::SendDart;

let mb = SendDart::new("mb_xxxxxxxxx");

let _campaigns = mb.campaigns.list(None).await?;
```

**Java**

```java
import com.senddart.SendDart;
import com.senddart.SendDartResponse;

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.campaigns().list();
```

**.NET**

```csharp
using SendDart;

ISendDart senddart = SendDartClient.Create("mb_xxxxxxxxx");

var resp = await senddart.CampaignListAsync();
```

**cURL**

```bash
curl -X GET 'https://www.senddart.com/api/campaigns' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart campaigns list
```

### Response

Returns a list object. `has_more` indicates whether further pages exist beyond the returned set.

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90",
      "name": "June newsletter",
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "segment_id": null,
      "status": "sent",
      "ab_test": { "enabled": false },
      "scheduled_at": null,
      "sent_at": "2026-06-23T10:20:00.000Z",
      "created_at": "2026-06-23T10:00:00.000Z"
    }
  ]
}
```
