Users and Teams
Manage user accounts with role-based filtering, team assignments, and admin impersonation capabilities.
Auth required: Yes (auth:api) for all endpoints.
Model Properties
User
| Property | Type | Required | Description |
|---|---|---|---|
id |
integer | auto | Unique identifier |
name |
string | Yes | Full name |
email |
string | Yes | Email address (unique). Used for login |
email_shown |
string | No | Public/displayed email address (may differ from login email) |
avatar |
image | No | Profile avatar image file |
role |
integer | No | Numeric role level. Higher = more access. Key thresholds: 5 = sales only, 8+ = access to all files, 20+ = admin/super_admin |
phone |
string | No | Office phone number |
phone_direct |
string | No | Direct line phone number |
location |
string | No | Office location or city |
mobile_phone |
string | No | Mobile phone number |
active |
boolean | No | Whether the user is active (can log in) |
manager |
boolean | No | Has manager role |
technical_manager |
boolean | No | Has technical manager role |
sales |
boolean | No | Has sales role |
technical |
boolean | No | Has technical role |
support_team |
boolean | No | Member of the support team |
sales_admin |
boolean | No | Has sales administration role |
admin |
boolean | No | Has admin role |
business_finder |
boolean | No | Has business finder role |
created_at |
datetime | auto | Creation timestamp |
updated_at |
datetime | auto | Last update timestamp |
Note: Passwords are managed separately and cannot be set via the API.
Team
| Property | Type | Required | Description |
|---|---|---|---|
id |
integer | auto | Unique identifier |
name |
string | Yes | Team name |
created_at |
datetime | auto | Creation timestamp |
updated_at |
datetime | auto | Last update timestamp |
Users
Base URL: /api/v1/users
GET /v1/users
List all users with filtering, sorting, and pagination.
Query parameters:
| Parameter | Type | Description |
|---|---|---|
filter[name] |
string | Filter by name |
filter[email] |
string | Filter by email |
filter[active] |
boolean | Filter active/inactive |
filter[role] |
integer | Filter by role level |
filter[phone] |
string | Filter by phone |
filter[mobile_phone] |
string | Filter by mobile phone |
filter[manager] |
boolean | Filter managers |
filter[technical_manager] |
boolean | Filter technical managers |
filter[sales] |
boolean | Filter sales users |
filter[technical] |
boolean | Filter technical users |
filter[support_team] |
boolean | Filter support team members |
filter[sales_admin] |
boolean | Filter sales admin users |
filter[admin] |
boolean | Filter admin users |
filter[business_finder] |
boolean | Filter business finders |
filter[term_match] |
string | Full-text term match |
sort |
string | Sort field (id, name, role, created_at, updated_at) |
per_page |
integer | Items per page (default 10) |
Response 200: Paginated list of user objects.
Returned columns: id, name, email, email_shown, avatar, role, phone, phone_direct, location, mobile_phone, active, manager, technical_manager, sales, technical, support_team, sales_admin, admin, business_finder, created_at, updated_at.
Examples:
curl -s -X GET "https://your-instance.bluerocktel.net/api/v1/users?filter[active]=true&filter[role]=3&sort=name&per_page=25" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
import requests
response = requests.get(
"https://your-instance.bluerocktel.net/api/v1/users",
params={
"filter[active]": "true",
"filter[role]": 3,
"sort": "name",
"per_page": 25,
},
headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
)
users = response.json()
use Illuminate\Support\Facades\Http;
$response = Http::withToken($token)
->acceptJson()
->get('https://your-instance.bluerocktel.net/api/v1/users', [
'filter[active]' => 'true',
'filter[role]' => 3,
'sort' => 'name',
'per_page' => 25,
]);
$users = $response->json();
const response = await fetch(
"https://your-instance.bluerocktel.net/api/v1/users?filter[active]=true&filter[role]=3&sort=name&per_page=25",
{
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
},
}
);
const users = await response.json();
POST /v1/users
Create a new user (standard resource route). Admin only.
Body (JSON): Standard user creation fields.
Response 201: Created user object.
GET /v1/users/{id}
Get a single user by ID. Includes teams and support_teams (if ticketing module enabled).
URL parameters:
| Parameter | Type | Description |
|---|---|---|
id |
integer | User ID |
Response 200: User object with teams. Response 404: Not found.
PUT /v1/users/{id}
Update a user.
URL parameters:
| Parameter | Type | Description |
|---|---|---|
id |
integer | User ID |
Response 200: Updated user object.
DELETE /v1/users/{id}
Delete a user.
Response 200: Success message.
POST /v1/impersonate
Impersonate another user (admin only).
Body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
user_id |
integer | Yes | ID of user to impersonate |
Response 200: Impersonation session established.
Examples:
curl -s -X POST "https://your-instance.bluerocktel.net/api/v1/impersonate" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"user_id": 5}'
import requests
response = requests.post(
"https://your-instance.bluerocktel.net/api/v1/impersonate",
json={"user_id": 5},
headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
)
session = response.json()
$response = Http::withToken($token)
->acceptJson()
->post('https://your-instance.bluerocktel.net/api/v1/impersonate', [
'user_id' => 5,
]);
$session = $response->json();
const response = await fetch(
"https://your-instance.bluerocktel.net/api/v1/impersonate",
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({ user_id: 5 }),
}
);
const session = await response.json();
GET /v1/impersonate
Leave impersonation and return to original user.
Response 200: Original session restored.
Teams
Base URL: /api/v1/teams
GET /v1/teams
List all teams ordered by name (no pagination).
Response 200: Array of all team objects.
POST /v1/teams
Create a new team.
Body (JSON): Validated via Team::keys().
Response 201: Created team object. Response 400: Validation error.
GET /v1/teams/{id}
Get a single team by ID with users relation.
URL parameters:
| Parameter | Type | Description |
|---|---|---|
id |
integer | Team ID |
Response 200: Team object with users. Response 404: Not found.
PUT /v1/teams/{id}
Update a team.
Body (JSON): Validated via Team::keys().
Response 201: Updated team object. Response 400/404: Error.
DELETE /v1/teams/{id}
Delete a team.
Response 201: Success message. Response 404: Not found.
On this page