Skip to main content

GET /api/v1/campaigns/

Returns a list of campaigns with optional workspace filtering. Authentication: Session-based (JWT Cookie) OR API Key (X-API-Key header)

Query Parameters

  • workspace_id (string, optional): Filter campaigns by workspace
    • Omit parameter: Returns campaigns from current workspace
    • workspace_id=123: Returns campaigns from workspace 123 (if user has access)
    • workspace_id=ALL: Returns campaigns from all workspaces user has access to

Security

Users can only access campaigns from workspaces they are linked to via linked_workspaces.

Response

{
  "campaigns": [
    {
      "id": 123,
      "name": "My Campaign",
      "status": "ACTIVE",
      "workspace_id": 340,
      "timezone": "Europe/Amsterdam",
      "language": "en",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z",
      "prospect_count": 150
    }
  ]
}

Examples

Using API Key (recommended for integrations):
# Get campaigns from current workspace
curl -X GET "https://app.seleqt.ai/api/v1/campaigns/" \
  -H "X-API-Key: your_api_key_here"

# Get campaigns from specific workspace
curl -X GET "https://app.seleqt.ai/api/v1/campaigns/?workspace_id=340" \
  -H "X-API-Key: your_api_key_here"

# Get campaigns from all workspaces
curl -X GET "https://app.seleqt.ai/api/v1/campaigns/?workspace_id=ALL" \
  -H "X-API-Key: your_api_key_here"
Using Session Cookie (for web apps):
curl -X GET "https://app.seleqt.ai/api/v1/campaigns/" \
  -H "Cookie: sessionid=your_session_id"

Error Responses

403 Forbidden - User doesn’t have access to specified workspace:
{
  "error": "Access denied"
}