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

FieldTypeDescription
id requiredstring

ID of the assignment or shift (ASG-prefixed for an assignment, otherwise a shift) to request a change for

Example ASG-J5A17Q-C1.

changeType requiredstring

Type of change requested (e.g., Time, Provider, Location)

Example Time.

reason requiredstring

Reason for requesting the change; sent to the organization and the assigned provider

Example That time, I have lots of work.

additionalDetailsstring or null

Any extra information about the request

Example Testing.

Example

JSON
{
  "id": "ASG-J5A17Q-C1",
  "changeType": "Time",
  "reason": "That time, I have lots of work",
  "additionalDetails": "Testing"
}

Example request

Shell
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

JSON
{
  "success": true,
  "message": "Request change notification sent successfully"
}
Response fields (2)
FieldTypeDescription
successboolean

Example true.

messagestring

Example Request change notification sent successfully.

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).

JSON
{
  "success": false,
  "message": "Assignment end date has passed."
}
Response fields (2)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Assignment end date has passed..

401 Not signed in

Unauthorized

JSON
{
  "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)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: API_KEY_MISSING, API_KEY_INVALID, API_KEY_EXPIRED. Example API_KEY_MISSING.

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.

JSON
{
  "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)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You don't have permission to access this endpoint. This API key is missing the 'assignments:edit' scope..

errorsany or null

Null on this status.

codestring

Always empty on this status.

Example .

422 Validation failed

Validation error

JSON
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "reason": [
      "The reason field is required."
    ]
  }
}
Response fields (3)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Validation failed.

errorsobject
429 Too many requests

Rate limit exceeded. See Retry-After.

JSON
{
  "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)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: RATE_LIMITED. Example RATE_LIMITED.

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.

JSON
{
  "success": false,
  "message": "An unexpected error occurred — please try again."
}
Response fields (2)
FieldTypeDescription
successboolean

Example false.

messagestring

Example An unexpected error occurred — please try again..