Skip to main content

List Referrals (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/referrals

Actual backend path: /v1/workspace/:workspaceId/referrals

Description

Get a paginated list of referrals for a workspace with optional search functionality.

Authentication

Required: Workspace authentication with appropriate permissions.

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1, min: 1)
limitnumberNoItems per page (default: 20, min: 1, max: 100)
searchstringNoSearch term to filter by name, email, phone, or WhatsApp number

Response 200 OK

{
"referrals": [
{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"name": "John Doe",
"email": "john.doe@example.com",
"countryCode": "+1",
"phone": "1234567890",
"whatsappNumber": "+11234567890",
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
],
"meta": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
}

Common Errors

  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Workspace not found
  • 500 Internal Server Error: Server error