Warehouse Staff
5 API calls in this section.
List Warehouse Staff
/warehousing/staff?tenant_id={{tenant_id}}&warehouse_id=&role=&status=&user_id=&search=&sort_by=created_at&sort_order=desc&column_filters=&page=1&limit=20&language=enRetrieves staff assigned to warehouses with optional filtering. Standalone params (warehouse_id, role, status, user_id, search) are kept for backward compatibility with form-modal callers. New list-page callers use column_filters + sort_by + sort_order. Response includes a stats block for KPI cards. column_filters example:
1curl --request GET "$ONDI_BASE_URL/warehousing/staff?tenant_id={{tenant_id}}&warehouse_id=&role=&status=&user_id=&search=&sort_by=created_at&sort_order=desc&column_filters=&page=1&limit=20&language=en" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
warehouse_idOptionalLegacy: filter by warehouse UUID (optional)
roleOptionalLegacy: filter by role — manager | supervisor | picker | receiver (optional)
statusOptionalLegacy: filter by status — active | inactive | on_leave (optional)
user_idOptionalLegacy: filter by specific user UUID (optional)
searchOptionalFull-text search across full_name, email, phone (optional)
sort_byOptionalcreated_at
Sort column — created_at (only supported value, default: created_at)
sort_orderOptionaldesc
Sort direction — asc | desc (optional, default: desc)
column_filtersOptionalJSON object of column filters, AND-combined. Supported keys: warehouse_id (exact), role (exact), status (exact), created_at ({from, to} date range). AND-combined with standalone params if same key is present.
pageOptional1
Page number for pagination (optional, default: 1)
limitOptional20
Number of items per page (optional, default: 20)
languageOptionalen
Response language (optional, default: en)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Warehouse staff retrieved successfully",4 "staff": [5 {6 "id": "staff-uuid-1",7 "tenant_id": "tenant-uuid",8 "warehouse_id": "warehouse-uuid-1",9 "user_id": "user-uuid-1",10 "role": "manager",11 "status": "active",12 "created_at": "2024-06-01T10:00:00Z",13 "updated_at": "2024-06-01T10:00:00Z",14 "warehouse": {15 "id": "warehouse-uuid-1",16 "name": "Main Distribution Center",17 "code": "WH001",18 "address_id": "address-uuid"19 },20 "user": {21 "id": "user-uuid-1",22 "email": "john.doe@example.com",23 "phone": "+15551234567",24 "full_name": "John Doe",25 "first_name": "John",26 "last_name": "Doe",27 "avatar_url": null28 }29 },30 {31 "id": "staff-uuid-2",32 "tenant_id": "tenant-uuid",33 "warehouse_id": "warehouse-uuid-1",34 "user_id": "user-uuid-2",35 "role": "picker",36 "status": "on_leave",37 "created_at": "2024-05-15T08:30:00Z",38 "updated_at": "2024-05-15T08:30:00Z",39 "warehouse": {40 "id": "warehouse-uuid-1",41 "name": "Main Distribution Center",42 "code": "WH001",43 "address_id": "address-uuid"44 },45 "user": {46 "id": "user-uuid-2",47 "email": "jane.smith@example.com",48 "phone": "+15559876543",49 "full_name": "Jane Smith",50 "first_name": "Jane",51 "last_name": "Smith",52 "avatar_url": null53 }54 }55 ],56 "stats": {57 "totalStaff": 15,58 "activeCount": 13,59 "inactiveCount": 1,60 "onLeaveCount": 161 },62 "page": 1,63 "limit": 20,64 "total": 1565}1{2 "success": true,3 "message": "Warehouse staff retrieved successfully",4 "staff": [5 {6 "id": "staff-uuid-1",7 "tenant_id": "tenant-uuid",8 "warehouse_id": "warehouse-uuid-1",9 "user_id": "user-uuid-1",10 "role": "manager",11 "status": "active",12 "created_at": "2025-03-10T09:00:00Z",13 "updated_at": "2025-03-10T09:00:00Z",14 "warehouse": {15 "id": "warehouse-uuid-1",16 "name": "Main Distribution Center",17 "code": "WH001",18 "address_id": "address-uuid"19 },20 "user": {21 "id": "user-uuid-1",22 "email": "john.doe@example.com",23 "phone": "+15551234567",24 "full_name": "John Doe",25 "first_name": "John",26 "last_name": "Doe",27 "avatar_url": null28 }29 }30 ],31 "stats": {32 "totalStaff": 15,33 "activeCount": 13,34 "inactiveCount": 1,35 "onLeaveCount": 136 },37 "page": 1,38 "limit": 20,39 "total": 140}1{2 "success": false,3 "message": "Tenant not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}1{2 "success": false,3 "field": "column_filters",4 "message": "invalid_json"5}1{2 "success": false,3 "message": "Internal server error"4}Assign User as Warehouse Staff
/warehousing/staff?tenant_id={{tenant_id}}Creates a new staff assignment for a user to a warehouse with a specific role. Verifies that the warehouse and user exist and belong to the specified tenant, and that the user is not already assigned to the warehouse. Authentication: - Requires valid authentication token - User must have 'manage:users:tenant' permission or be a system admin Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Business Rules: - User must be a member of the specified tenant - Warehouse must exist and belong to the specified tenant - Role must be one of: "manager", "supervisor", "picker", "receiver" - Status must be one of: "active", "inactive", "on_leave" - A user cannot be assigned to the same warehouse more than once
1curl --request POST "$ONDI_BASE_URL/warehousing/staff?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "warehouse_id": "{{warehouse_id}}",7 "user_id": "{{user_id}}",8 "role": "manager",9 "status": "active"10}'1{2 "warehouse_id": "{{warehouse_id}}",3 "user_id": "{{user_id}}",4 "role": "manager",5 "status": "active"6}Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Request body fields
warehouse_idExampleExample field from the request body.
user_idExampleExample field from the request body.
roleExampleExample field from the request body.
statusExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Warehouse staff assigned successfully",4 "Staff": {5 "id": "assignment-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid-1",8 "user_id": "user-uuid-1",9 "role": "manager",10 "status": "active",11 "created_at": "2023-04-15T10:30:00Z",12 "updated_at": "2023-04-15T10:30:00Z",13 "warehouse": {14 "id": "warehouse-uuid-1",15 "name": "Main Distribution Center",16 "code": "WH001"17 },18 "user": {19 "id": "user-uuid-1",20 "first_name": "John",21 "last_name": "Doe",22 "email": "john.doe@example.com"23 }24 }25}1{2 "success": false,3 "message": "Field required role"4}1{2 "success": false,3 "message": "Invalid role: invalid-role"4}1{2 "success": false,3 "message": "Invalid status: invalid-status"4}1{2 "success": false,3 "message": "User already assigned to warehouse"4}1{2 "success": false,3 "message": "Warehouse not found"4}1{2 "success": false,3 "message": "User not found or not tenant member"4}Update Warehouse Staff
/warehousing/staff/:id?tenant_id={{tenant_id}}Updates an existing warehouse staff assignment with new role or status information. Authentication: - Requires valid authentication token - User must have 'manage:users:tenant' permission or be a system admin Path Parameters: - id (required): UUID of the staff assignment to update Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Business Rules: - Staff assignment must exist and belong to the specified tenant - At least one field (role or status) must be provided for update - If role is provided, it must be one of: "manager", "supervisor", "picker", "receiver" - If status is provided, it must be one of: "active", "inactive", "on_leave" - Updated timestamp is automatically set to current time
1curl --request PUT "$ONDI_BASE_URL/warehousing/staff/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "role": "supervisor",7 "status": "on_leave"8}'1{2 "role": "supervisor",3 "status": "on_leave"4}Path parameters
idRequired{{staff_assignment_id}}
UUID of the staff assignment to update (required)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Request body fields
roleExampleExample field from the request body.
statusExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Warehouse staff updated successfully",4 "staff": {5 "id": "staff-assignment-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid-1",8 "user_id": "user-uuid-1",9 "role": "supervisor",10 "status": "on_leave",11 "created_at": "2023-01-01T00:00:00Z",12 "updated_at": "2023-04-15T15:30:00Z",13 "warehouse": {14 "id": "warehouse-uuid-1",15 "name": "Main Distribution Center",16 "code": "WH001",17 "address_id": "address-uuid"18 },19 "user": {20 "id": "user-uuid-1",21 "first_name": "John",22 "last_name": "Doe",23 "email": "john.doe@example.com",24 "phone": "+15551234567",25 "avatar_url": null,26 "full_name": "John Doe"27 }28 }29}1{2 "success": false,3 "message": "Staff assignment not found"4}Get Warehouse Staff by ID (or Own Profile)
/warehousing/staff/:staff_id?tenant_id={{tenant_id}}Retrieves warehouse staff details by ID. If the ID belongs to the current user, it returns as 'profile', otherwise as 'staff'. System automatically detects ownership. Authentication: - Requires valid authentication token - For own profile: any warehouse staff member - For others: requires 'view:tenant' or 'manage:users:tenant' permission Path Parameters: - staff_id (required): UUID of the warehouse staff record Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Response: - Returns warehouse staff details with user and warehouse information - Uses 'profile' key if viewing own data, 'staff' key if viewing others
1curl --request GET "$ONDI_BASE_URL/warehousing/staff/:staff_id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
staff_idRequired{{staff_id}}
UUID of the warehouse staff record (the API automatically detects if this is your own profile)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Profile retrieved successfully",4 "profile": {5 "id": "staff-uuid-1",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid-1",8 "user_id": "user-uuid-1",9 "role": "picker",10 "status": "active",11 "created_at": "2023-01-01T00:00:00Z",12 "updated_at": "2023-01-01T00:00:00Z",13 "warehouse": {14 "id": "warehouse-uuid-1",15 "name": "Main Distribution Center",16 "code": "WH001",17 "address_id": "address-uuid"18 },19 "user": {20 "id": "user-uuid-1",21 "first_name": "John",22 "last_name": "Doe",23 "email": "john.doe@example.com",24 "phone": "+15559876543",25 "avatar_url": "https://example.com/avatars/john.jpg",26 "full_name": "John Doe"27 }28 }29}1{2 "success": false,3 "message": "Warehouse staff profile not found"4}Update Warehouse Staff by ID (or Own Profile)
/warehousing/staff/:staff_id?tenant_id={{tenant_id}}Updates warehouse staff details by ID. If the ID belongs to the current user, they can update personal info + status. System automatically detects ownership and permissions. Authentication: - Requires valid authentication token - For own profile: any warehouse staff member (can update personal info + status) - For others: requires 'manage:users:tenant' permission (can update role + status only) Path Parameters: - staff_id (required): UUID of the warehouse staff record Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Business Rules: - System detects if user is updating own profile vs others - Own profile: can update user fields + staff status - Others: admin can update role + status only - Updates both user and warehouse_staff tables as needed
1curl --request PUT "$ONDI_BASE_URL/warehousing/staff/:staff_id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "first_name": "John",7 "last_name": "Smith",8 "phone": "+15559876543",9 "avatar_url": "https://example.com/new-avatar.jpg",10 "status": "active"11}'1{2 "first_name": "John",3 "last_name": "Smith",4 "phone": "+15559876543",5 "avatar_url": "https://example.com/new-avatar.jpg",6 "status": "active"7}Path parameters
staff_idRequired{{staff_id}}
UUID of the warehouse staff record (the API automatically detects if this is your own profile)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Request body fields
first_nameExampleExample field from the request body.
last_nameExampleExample field from the request body.
phoneExampleExample field from the request body.
avatar_urlExampleExample field from the request body.
statusExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Profile updated successfully",4 "profile": {5 "id": "staff-uuid-1",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid-1",8 "user_id": "user-uuid-1",9 "role": "picker",10 "status": "active",11 "created_at": "2023-01-01T00:00:00Z",12 "updated_at": "2023-04-15T16:30:00Z",13 "warehouse": {14 "id": "warehouse-uuid-1",15 "name": "Main Distribution Center",16 "code": "WH001",17 "address_id": "address-uuid"18 },19 "user": {20 "id": "user-uuid-1",21 "first_name": "John",22 "last_name": "Smith",23 "email": "john.doe@example.com",24 "phone": "+15559876543",25 "avatar_url": "https://example.com/avatars/john.jpg",26 "full_name": "John Smith"27 }28 }29}1{2 "success": false,3 "message": "Invalid enum value: invalid-status"4}1{2 "success": false,3 "message": "Warehouse staff profile not found"4}