List Users in Operating Unit
Retrieves a paginated list of users assigned to a specific operating unit, including their roles.
Path Parameters
Query Parameters
Number of items per page (1-100)
Response
Array of user objectsArray of role objects assigned to the user Pivot table data for the user-operating unit relationshipRole specific to this assignment
Whether the assignment is active
Additional assignment metadata
Assignment creation timestamp
Assignment last update timestamp
Example Request
curl -X GET "https://api.sushigo.local/api/v1/operating-units/1/users?per_page=10" \
-H "Accept: application/json"
const response = await fetch('https://api.sushigo.local/api/v1/operating-units/1/users?per_page=10', {
method: 'GET',
headers: {
'Accept': 'application/json'
}
});
const data = await response.json();
Example Response
{
"data": [
{
"id": 3,
"name": "John Smith",
"email": "[email protected]",
"roles": [
{
"id": 2,
"name": "inventory-manager"
}
],
"pivot": {
"operating_unit_id": 1,
"user_id": 3,
"assignment_role": null,
"is_active": true,
"meta": null,
"created_at": "2026-02-10T08:15:00+00:00",
"updated_at": "2026-02-10T08:15:00+00:00"
}
}
],
"current_page": 1,
"per_page": 10,
"total": 1,
"last_page": 1
}
Error Responses
Operating unit not found{
"message": "Not found"
}
Add User to Operating Unit
Assigns a user to an operating unit. Users must be assigned to an operating unit to perform inventory operations within that unit.
Path Parameters
Request Body
ID of the user to assign to the operating unit
Response
Example Request
curl -X POST "https://api.sushigo.local/api/v1/operating-units/1/users" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"user_id": 3
}'
const response = await fetch('https://api.sushigo.local/api/v1/operating-units/1/users', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
user_id: 3
})
});
const data = await response.json();
Example Response
{
"data": {
"message": "User added to operating unit successfully",
"operating_unit": {
"id": 1,
"name": "Main Kitchen",
"type": "BRANCH_MAIN"
},
"user": {
"id": 3,
"name": "John Smith",
"email": "[email protected]"
}
},
"status": 200,
"meta": {}
}
Error Responses
Operating unit or user not found{
"message": "Not found"
}
User already assigned to operating unit{
"status": 409,
"message": "User is already assigned to this operating unit",
"errors": []
}
Validation error{
"message": "The given data was invalid.",
"errors": {
"user_id": ["The user id field is required."]
}
}
Remove User from Operating Unit
Removes a user assignment from an operating unit. This prevents the user from performing operations in this specific operating unit.
Path Parameters
User ID to remove from the operating unit
Response
Example Request
curl -X DELETE "https://api.sushigo.local/api/v1/operating-units/1/users/3" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"
const response = await fetch('https://api.sushigo.local/api/v1/operating-units/1/users/3', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
});
const data = await response.json();
Example Response
{
"data": {
"message": "User removed from operating unit successfully"
},
"status": 200,
"meta": {}
}
Error Responses
Operating unit not found or user not assigned{
"status": 404,
"message": "User is not assigned to this operating unit",
"errors": []
}