API reference › Assignments › Cancel, change and reassign
Submit a change request for an assignment or shift
POST /v1/assignment/request-change-assignment
- Scope
assignments:edit- Roles
- admin, client, scheduler, consumer
Records a request to change an assignment or shift (e.g., time, provider, location) and notifies the organization — it does not change the assignment/shift itself. Typically called by the client or consumer attached to it to tell the assignment manager what they'd like changed (admin and scheduler may also call this directly, e.g. on a client's behalf). On success this emails the currently assigned provider with the requested change and reason, and notifies the organization's admins/schedulers so one of them can action the actual change.
Parameters
None of its own.
Every call also sends Authorization and X-Tenant-ID; see Getting started.
Request body required
| Field | Type | Description |
|---|---|---|
id required | string | ID of the assignment or shift (ASG-prefixed for an assignment, otherwise a shift) to request a change for Example |
changeType required | string | Type of change requested (e.g., Time, Provider, Location) Example |
reason required | string | Reason for requesting the change; sent to the organization and the assigned provider Example |
additionalDetails | string or null | Any extra information about the request Example |
Example
{
"id": "ASG-J5A17Q-C1",
"changeType": "Time",
"reason": "That time, I have lots of work",
"additionalDetails": "Testing"
}Example request
curl -X POST "https://api.fetchfido.ai/v1/assignment/request-change-assignment" \
-H "Authorization: Bearer $FIDO_API_KEY" \
-H "X-Tenant-ID: $FIDO_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{"id":"ASG-J5A17Q-C1","changeType":"Time","reason":"That time, I have lots of work","additionalDetails":"Testing"}'Try it
Responses
200 Change request recorded and the organization notified
Change request recorded and the organization notified
{
"success": true,
"message": "Request change notification sent successfully"
}Response fields (2)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
400 Bad request
Request rejected — the assignment/shift is not in a state that can be changed (already completed, already canceled, not yet filled, or its end date has passed).
{
"success": false,
"message": "Assignment end date has passed."
}Response fields (2)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
401 Not signed in
Unauthorized
{
"success": false,
"message": "Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for.",
"errors": null,
"code": "API_KEY_MISSING"
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Machine-readable reason, for branching on in client code. One of: |
403 Not allowed
Forbidden — a client or consumer who is not attached to this assignment/shift. The message is generic on purpose, so the response can't be used to tell a real id apart from one belonging to someone else.
{
"success": false,
"message": "You don't have permission to access this endpoint. This API key is missing the 'assignments:edit' scope.",
"errors": null,
"code": ""
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Always empty on this status. Example |
422 Validation failed
Validation error
{
"success": false,
"message": "Validation failed",
"errors": {
"reason": [
"The reason field is required."
]
}
}Response fields (3)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | object |
429 Too many requests
Rate limit exceeded. See Retry-After.
{
"success": false,
"message": "You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds.",
"errors": null,
"code": "RATE_LIMITED"
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Machine-readable reason, for branching on in client code. One of: |
500 Server error
Internal server error. Also returned for an id that does not match an assignment or shift; this endpoint does not return 404.
{
"success": false,
"message": "An unexpected error occurred — please try again."
}Response fields (2)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |