Skip to main content

GET /api/v1/dashboard/campaign-analytics/

Returns aggregated analytics for campaigns with optional workspace filtering. Authentication: Session-based (JWT Cookie) OR API Key (X-API-Key header)

Query Parameters

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

Security

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

Response

{
  "campaigns": [
    {
      "id": 123,
      "name": "My Campaign",
      "status": "ACTIVE",
      "workspace_id": 340,
      "analytics": {
        "amount_of_prospects": 150,
        "amount_of_emails_sent": 45,
        "amount_of_invites_sent": 30,
        "amount_of_invites_accepted": 12,
        "amount_of_linkedin_messages_sent": 25,
        "amount_of_prospects_contacted": 70,
        "amount_of_replies": 8,
        "amount_of_interested": 3,
        "average_reply_time": "2 days"
      }
    }
  ]
}

Examples

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

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

# Get analytics from all workspaces
curl -X GET "https://app.seleqt.ai/api/v1/dashboard/campaign-analytics/?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/dashboard/campaign-analytics/" \
  -H "Cookie: sessionid=your_session_id"

Error Responses

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

Use Cases

  1. Dashboard Overview: Use workspace_id=ALL to show aggregated metrics across all user’s workspaces
  2. Workspace-Specific View: Use specific workspace_id to filter analytics for a single workspace
  3. Current Workspace: Omit parameter for default behavior (current workspace only)