Skip to main content
GET
/
api
/
audience
Get all audiences for organization with pagination
curl --request GET \
  --url http://localhost:3000/api/audience
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "organizationId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "VIP Customers",
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z",
      "contactCount": 150,
      "description": "High-value customers for priority campaigns"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8,
    "hasNextPage": true,
    "hasPreviousPage": false
  }
}

Query Parameters

page
number
default:1

Page number (1-based)

Required range: x >= 1
Example:

1

limit
number
default:20

Number of items per page

Required range: 1 <= x <= 100
Example:

20

Search term to filter results

Maximum string length: 100
Example:

"john"

sortBy
string

Field to sort by

Example:

"createdAt"

sortOrder
enum<string>
default:desc

Sort order

Available options:
asc,
desc
Example:

"desc"

Response

200 - application/json
data
object[]
required
meta
object
required