Skip to main content
GET
/
api
/
contact
Get all contacts for organization with pagination
curl --request GET \
  --url http://localhost:3000/api/contact
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "organizationId": "123e4567-e89b-12d3-a456-426614174000",
      "primaryPhone": "+212612345678",
      "channels": [],
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z",
      "firstName": "John",
      "lastName": "Doe",
      "fullName": "John Doe",
      "primaryEmail": "john@example.com",
      "address": "123 Main St",
      "city": "Casablanca",
      "state": "Casablanca-Settat",
      "zip": "20000",
      "occupation": "Engineer",
      "preferredChannel": "phone",
      "gender": "male"
    }
  ],
  "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

Paginated list of contacts

data
object[]
required
meta
object
required