List the employee directory

Returns the rooftop's directory contacts with their department names. Supports search, active filter and paging.

GEThttps://api.spyne.ai/user-management/v1/directory/enterprise/{enterpriseId}/team/{teamId}/get-directory
AuthBearer token (console user)Rate limitNot documentedProcessingSynchronous. Database reads only.

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 enterpriseId and teamId.

  • limit must be 1 to 100. page starts 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

Requiredalways sendOptionalcan be left out
Request checklist
  1. Put enterpriseId and teamId in the path.
  2. Add page and limit for paged results. The UI uses limit=10 on the directory screen and limit=50 on the brand registration form.
  3. Add keyword and/or active to filter.
ParameterTypeRequiredDescription
Path parameters——Sent in the URL path.
enterpriseIdstringRequiredDealer group ID.
teamIdstringRequiredRooftop ID.
Query parameters——Sent in the query string.
keywordstringOptionalSearch on first name, last name or email.
activebooleanOptionaltrue or false.
pagenumberOptionalDefault 1. Sending page or limit turns on paging.
limitnumberOptionalDefault 20 when paging. 1 to 100.
Headers——Sent as HTTP headers.
AuthorizationstringRequiredBearer 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

ParameterTypeDescription
data.page, limit, total, totalPages, hasNext, hasPrevnumber / booleanPaging info. Only present when paging.
data.countnumberRows in this response.
data.contacts[].idnumberContact ID. The brand registration form uses this as employeeId.
data.contacts[].first_name, last_name, designation, emailstringContact details.
data.contacts[].phone, extensionstringPhone in E.164 format, and extension.
data.contacts[].is_activenumber / booleanActive flag as stored. The UI treats 1 as active.
data.contacts[].department_id, department_namenumber / stringDepartment.
data.contacts[].department_phone, department_extensionstring or nullDepartment's own line.

Errors

StatusReasonWhen it happens
400ERROR_BAD_REQ_400Missing IDs, bad active, page < 1, or limit outside 1 to 100.
401ERROR_AUTH_401Missing or invalid token.
500ERROR_SERVER_500Database error.

Next

Show the directory. Add contacts with Add directory contacts or Upload the employee directory.


Did this page help you?