# 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 { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Campaigns.list
```

**PHP**

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

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Campaigns.list()
```

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

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

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.campaigns().list();
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

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

**cURL**

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

**CLI**

```bash
sendping 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"
    }
  ]
}
```
