Skip to main content
Retrieves a paginated list of all broadcasts.

Methods

List

List() (ListBroadcastsResponse, error)
Lists all broadcasts using the default background context.

ListWithContext

ListWithContext(ctx context.Context) (ListBroadcastsResponse, error)
Lists all broadcasts with a custom context for cancellation and timeout control.

ListWithOptions

ListWithOptions(ctx context.Context, options *ListOptions) (ListBroadcastsResponse, error)
Lists broadcasts with pagination options.

Query Parameters

When using ListWithOptions, you can pass a ListOptions struct with the following fields:
limit
number
The maximum number of broadcasts to return per page.
offset
number
The number of broadcasts to skip before starting to return results.

Response

object
string
The object type, always list.
data
Broadcast[]
An array of broadcast objects.
has_more
boolean
Indicates whether there are more broadcasts available beyond the current page.

Example

package main

import (
    "fmt"
    "github.com/resend/resend-go/v2"
)

func main() {
    client := resend.NewClient("re_123456789")

    broadcasts, err := client.Broadcasts.List()
    if err != nil {
        panic(err)
    }

    fmt.Println("Total broadcasts:", len(broadcasts.Data))
    for _, broadcast := range broadcasts.Data {
        fmt.Printf("%s: %s (Status: %s)\n", broadcast.Id, broadcast.Name, broadcast.Status)
    }
}

Example with pagination

package main

import (
    "context"
    "fmt"
    "github.com/resend/resend-go/v2"
)

func main() {
    client := resend.NewClient("re_123456789")

    options := &resend.ListOptions{
        Limit:  10,
        Offset: 0,
    }

    broadcasts, err := client.Broadcasts.ListWithOptions(context.Background(), options)
    if err != nil {
        panic(err)
    }

    fmt.Println("Has more:", broadcasts.HasMore)
}

Build docs developers (and LLMs) love