Overview /
Operations /
Assign an employee to a shift
Assign an employee to a shift
post
https://api.flactrum.com/v1/shift-assignments
The same rules as the panel apply: the employee must work at the shift's branch, must not have left, must have valid documents, and must not already be on an overlapping shift that day. A rejection says which rule was hit.
| Required scope | shifts.write |
| Success status | 201 |
| Returns | One ShiftAssignment object |
Request body
| Field | Type | Description |
|---|---|---|
| shift_id * | string | — |
| employee_id * | string | — |
| branch_id | string|null | Defaults to the shift's branch. |
| work_date * | string | — |
| status | string | — |
| note | string|null | — |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| shift_id | string | — |
| employee_id | string | — |
| branch_id | string | — |
| work_date | string | — |
| status | string | — |
| note | string|null | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/shift-assignments' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"shift_id": "01m43mzaz6mv4p7g2ek5pp4j6h",
"employee_id": "01m43mzaz8sxcszffawy57vfy7",
"work_date": "2026-10-05"
}'
HTTP 201 · application/json
{
"data": {
"id": "01m43mzazr980y6epjwgqz4620",
"shift_id": "01m43mzaz6mv4p7g2ek5pp4j6h",
"shift": {
"id": "01m43mzaz6mv4p7g2ek5pp4j6h",
"branch_id": "01m43mzayxt6yszc3te0n120hx",
"name": "Sabah",
"start_time": "07:00:00",
"end_time": "15:00:00",
"crosses_midnight": false,
"color": null,
"created_at": "2026-10-04T14:27:04+00:00",
"updated_at": "2026-10-04T14:27:04+00:00"
},
"employee_id": "01m43mzaz8sxcszffawy57vfy7",
"employee": {
"id": "01m43mzaz8sxcszffawy57vfy7",
"first_name": "Şahnur",
"last_name": "Çörekçi",
"full_name": "Şahnur Çörekçi",
"position": "Barista",
"phone": null,
"email": null,
"status": "active",
"branch_id": "01m43mzayxt6yszc3te0n120hx",
"user_id": null,
"hired_at": "2024-12-04",
"left_at": null,
"monthly_gross_salary": null,
"insurance_rate": null,
"note": null,
"created_at": "2026-10-04T14:27:04+00:00",
"updated_at": "2026-10-04T14:27:04+00:00"
},
"branch_id": "01m43mzayxt6yszc3te0n120hx",
"work_date": "2026-10-05",
"status": "planned",
"note": null,
"created_at": "2026-10-04T14:27:04+00:00",
"updated_at": "2026-10-04T14:27:04+00:00"
}
}
curl -X POST 'https://api.flactrum.com/v1/shift-assignments' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"shift_id": "01m43mzb470mmakmfesepzv7e7",
"employee_id": "01m43mzb498ghatjg5t0b00vxn",
"work_date": "2026-10-05"
}'
HTTP 422 · application/json
{
"error": {
"code": "validation_failed",
"message": "The submitted data is invalid.",
"details": {
"fields": {
"employee_id": [
"This employee is already assigned to that shift on that day."
]
}
}
}
}