curl --request POST \
--url https://api.example.com/api/v1/employees \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"roles": [
{}
],
"email": "<string>",
"phone": "<string>",
"branch_id": 123,
"start_date": "<string>",
"meta": {}
}
'{
"422": {},
"status": 123,
"data": {
"id": "<string>",
"code": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"is_active": true,
"email": "<string>",
"phone": "<string>",
"roles": [
{}
],
"employment_periods": [
{
"id": "<string>",
"branch_id": 123,
"branch": {},
"start_date": "<string>",
"end_date": "<string>",
"is_active": true
}
],
"meta": {},
"created_at": "<string>",
"updated_at": "<string>"
}
}Create a new employee with user account and initial employment period
curl --request POST \
--url https://api.example.com/api/v1/employees \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"roles": [
{}
],
"email": "<string>",
"phone": "<string>",
"branch_id": 123,
"start_date": "<string>",
"meta": {}
}
'{
"422": {},
"status": 123,
"data": {
"id": "<string>",
"code": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"is_active": true,
"email": "<string>",
"phone": "<string>",
"roles": [
{}
],
"employment_periods": [
{
"id": "<string>",
"branch_id": 123,
"branch": {},
"start_date": "<string>",
"end_date": "<string>",
"is_active": true
}
],
"meta": {},
"created_at": "<string>",
"updated_at": "<string>"
}
}email or phone must be provided. When both are provided, the employee will have both contact methods available."EMP-001""Juan""Pérez"manager, cook, kitchen-assistant, delivery-driver, acting-manager, adminSuper-admin only: super-admin role can only be assigned by users with the super-admin roleExample: ["cook", "kitchen-assistant"]phone is not provided. Must be unique across all users.Format: Valid email address (max 255 characters)Example: "[email protected]"email is not provided. Must be unique across all users.Format: 10-digit national phone number without country code (spaces and dashes are automatically stripped)Example: "5512345678" or "55 1234 5678"1"2026-01-15"{"emergency_contact": "555-9999", "notes": "Bilingual"}Show Employee Object
true for new employees)curl -X POST "https://api.sushigo.local/api/v1/employees" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "EMP-001",
"first_name": "Juan",
"last_name": "Pérez",
"roles": ["cook", "kitchen-assistant"],
"email": "[email protected]",
"branch_id": 1,
"start_date": "2026-01-15"
}'
curl -X POST "https://api.sushigo.local/api/v1/employees" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "EMP-002",
"first_name": "María",
"last_name": "González",
"roles": ["manager"],
"phone": "5587654321",
"branch_id": 1,
"start_date": "2026-02-01"
}'
curl -X POST "https://api.sushigo.local/api/v1/employees" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "EMP-003",
"first_name": "Carlos",
"last_name": "Ramírez",
"roles": ["delivery-driver"],
"email": "[email protected]",
"phone": "5598765432",
"branch_id": 2,
"start_date": "2026-02-15",
"meta": {
"vehicle_type": "motorcycle",
"license_plate": "ABC-123"
}
}'
{
"status": 201,
"data": {
"id": "01JKXYZ1234567890ABCDEFGH",
"code": "EMP-001",
"first_name": "Juan",
"last_name": "Pérez",
"is_active": true,
"email": "[email protected]",
"phone": null,
"roles": ["cook", "kitchen-assistant"],
"employment_periods": [
{
"id": "01JKXYZ9876543210ZYXWVUTS",
"branch_id": 1,
"branch": {
"id": 1,
"name": "SushiGo Centro",
"code": "CENTRO"
},
"start_date": "2026-01-15",
"end_date": null,
"is_active": true
}
],
"meta": null,
"created_at": "2026-01-15T14:30:00+00:00",
"updated_at": "2026-01-15T14:30:00+00:00"
}
}
GET /api/v1/employees/next-code
{
"code": "EMP-006",
"prefix": "EMP-"
}
curl -X GET "https://api.sushigo.local/api/v1/employees/next-code" \
-H "Authorization: Bearer YOUR_TOKEN"