List the employee directory
Returns the rooftop's directory contacts with their department names. Supports search, active filter and paging.
Reads directory contacts for the rooftop, newest first, with each contact's department name, phone and extension. keyword matches first name, last name or email, ignoring case. active filters by status. If you send page or limit, the response is paged and includes totals. Otherwise every matching row is returned. Nothing is written.
Before you call it
-
You need
enterpriseIdandteamId. -
limitmust be 1 to 100.pagestarts at 1. -
Authentication: Bearer token of a signed-in console user. The token is checked; the route does not check that the caller belongs to the rooftop.
-
Rate limit: Not documented
-
Processing: Synchronous. Database reads only.
Request
- Put
enterpriseIdandteamIdin the path. - Add
pageandlimitfor paged results. The UI useslimit=10on the directory screen andlimit=50on the brand registration form. - Add
keywordand/oractiveto filter.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Path parameters | — | — | Sent in the URL path. |
enterpriseId | string | Required | Dealer group ID. |
teamId | string | Required | Rooftop ID. |
| Query parameters | — | — | Sent in the query string. |
keyword | string | Optional | Search on first name, last name or email. |
active | boolean | Optional | true or false. |
page | number | Optional | Default 1. Sending page or limit turns on paging. |
limit | number | Optional | Default 20 when paging. 1 to 100. |
| Headers | — | — | Sent as HTTP headers. |
Authorization | string | Required | Bearer YOUR_TOKEN |
Sample request
curl -X GET "https://api.spyne.ai/user-management/v1/directory/enterprise/<enterpriseId>/team/<teamId>/get-directory?page=1&limit=10" \
-H "Authorization: Bearer YOUR_TOKEN"import requests
res = requests.get(
"https://api.spyne.ai/user-management/v1/directory/enterprise/<enterpriseId>/team/<teamId>/get-directory",
params={"page": 1, "limit": 10},
headers={"Authorization": "Bearer YOUR_TOKEN"},
)
print(res.status_code, res.json())const res = await fetch(
"https://api.spyne.ai/user-management/v1/directory/enterprise/<enterpriseId>/team/<teamId>/get-directory?page=1&limit=10",
{ headers: { Authorization: "Bearer YOUR_TOKEN" } }
);
console.log(res.status, await res.json());Sample response
{
"message": "Directory data fetched successfully",
"error": false,
"code": "",
"details": null,
"data": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNext": false,
"hasPrev": false,
"count": 1,
"contacts": [
{
"id": 101,
"enterprise_id": "<enterpriseId>",
"team_id": "<teamId>",
"first_name": "Jane",
"last_name": "Doe",
"designation": "Service Advisor",
"phone": "+15550100000",
"extension": "204",
"email": "[email protected]",
"is_active": 1,
"department_id": 7,
"department_name": "service",
"department_phone": "+15550100002",
"department_extension": null
}
]
}
}{ "message": "limit must be a number between 1 and 100", "error": true, "code": "ERROR_BAD_REQ_400", "details": null, "data": null }{ "message": "Invalid Token", "error": true, "code": "ERROR_AUTH_401", "details": "", "data": null }{ "message": "...", "error": true, "code": "ERROR_SERVER_500", "details": null, "data": null }200 OK (paged). Without page/limit, data is {count, contacts} only. With no rows, message is No directory data found.
400 Bad Request. Other 400 messages: enterpriseId and teamId are required, active must be a boolean (true/false), page must be a number greater than or equal to 1.
Response fields
| Parameter | Type | Description |
|---|---|---|
data.page, limit, total, totalPages, hasNext, hasPrev | number / boolean | Paging info. Only present when paging. |
data.count | number | Rows in this response. |
data.contacts[].id | number | Contact ID. The brand registration form uses this as employeeId. |
data.contacts[].first_name, last_name, designation, email | string | Contact details. |
data.contacts[].phone, extension | string | Phone in E.164 format, and extension. |
data.contacts[].is_active | number / boolean | Active flag as stored. The UI treats 1 as active. |
data.contacts[].department_id, department_name | number / string | Department. |
data.contacts[].department_phone, department_extension | string or null | Department's own line. |
Errors
| Status | Reason | When it happens |
|---|---|---|
400 | ERROR_BAD_REQ_400 | Missing IDs, bad active, page < 1, or limit outside 1 to 100. |
401 | ERROR_AUTH_401 | Missing or invalid token. |
500 | ERROR_SERVER_500 | Database error. |
Next
Show the directory. Add contacts with Add directory contacts or Upload the employee directory.
- Called before: Save departments, hours and holidays.
- Called after: Add directory contacts, Upload the employee directory, Submit or save the brand registration.
Updated about 1 hour ago
