# List Blasts

`POST /messages/blasts/list`

List all blasts with optional filtering and pagination. Results are sorted by creation date, newest first.

## Authentication

Send your API key in the `PINNACLE-API-KEY` header.

## Request body

Required.

Content type: `application/json`.

### Fields

- `pageIndex` — `integer`, optional, default: 0; minimum: 0
- `pageSize` — `integer`, optional, default: 20; minimum: 1; maximum: 100
- `audienceId` — `string`, optional. Filter blasts by audience ID.
- `sender` — `string`, optional. Filter blasts that include this sender (phone number or agent ID).
- `content` — `string`, optional. Search blast content (partial match, case-insensitive).

### Example

```json
{
  "pageIndex": 0,
  "pageSize": 20,
  "audienceId": "aud_01J8K3R7M9",
  "sender": "agent_pinnacle",
  "content": "Hello from Pinnacle!"
}
```

## Responses

### 200

Returns paginated list of blasts.

Content type: `application/json`. Schema: `ListBlastsResponse`.

- `data` — `object[]`
- `data[].id` — `string`. Unique identifier for the blast.
- `data[].audienceId` — `string`. Audience ID associated with this blast.
- `data[].type` — `string`, values: `SMS`, `MMS`, `RCS`. Type of the blast message.
- `data[].senders` — `string[]`. Sender identifiers (phone numbers or agent IDs) used for the blast.
- `data[].content` — `object`. Message content sent in the blast.
- `data[].options` — `object`. Blast options configuration.
- `data[].fallback` — `object`. Fallback message configuration, if any.
- `data[].createdAt` — `string`. ISO 8601 timestamp of when the blast was created.
- `hasMore` — `boolean`
- `count` — `integer`

Example:

```json
{
  "data": [
    {
      "id": "blast_abc123",
      "audienceId": "aud_abc123",
      "type": "SMS",
      "senders": [
        "+12125551234"
      ],
      "content": {
        "text": "Flash sale — 20% off everything today!"
      },
      "options": null,
      "fallback": null,
      "createdAt": "2025-01-15T10:30:00Z"
    }
  ],
  "hasMore": false,
  "count": 1
}
```

### 400

Validation failed. The payload has missing required fields and/or invalid types.

See https://zod.dev/error-formatting for more information.

Content type: `application/json`. Schema: `object`.

- `description` — `string`. Human-readable summary of validation failures.
- `errors` — `object`. Structured dictionary of issues containing two main sections:
- `errors`: Array of global validation errors not tied to specific fields
- `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array

Example:

```json
{
  "description": "✖ Invalid input: expected string, received number\n  → at example_field",
  "errors": {
    "errors": [
      "Unrecognized key: 'extraKey'"
    ],
    "properties": {
      "example_field": {
        "errors": [
          "Invalid input: expected string, received NaN"
        ]
      }
    }
  }
}
```

### 401

The request lacks valid authentication credentials or the provided credentials are invalid.

Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "Invalid API key."
}
```

### 500

An unexpected error occurred on Pinnacle's servers while processing your request.

If this error persists, please contact support with the request details.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "An unexpected error occurred while processing your request."
}
```

## SDK examples

### TypeScript

```typescript
import { PinnacleClient } from "rcs-js";

const client = new PinnacleClient({
  apiKey: process.env.PINNACLE_API_KEY!,
});

await client.messages.blasts.list();
```

### Python

```python
import os
from rcs import Pinnacle

client = Pinnacle(
    api_key=os.environ["PINNACLE_API_KEY"],
)

client.messages.blasts.list()
```

### Ruby

```ruby
require "rcs"

client = Pinnacle::Client.new(
  api_key: ENV.fetch("PINNACLE_API_KEY")
)

client.messages.blasts.list
```

## Machine-readable schema

[OpenAPI 3.1 JSON](https://docs.pinnacle.sh/openapi.json)
