API reference › Assignments › Provider portal
Withdraw or edit coverage for an assignment
PATCH /v1/settings/portal/provider/assignment/{type}/{id}
- Scope
assignments:edit- Roles
- service-provider
Allows service providers to withdraw from an assignment or edit their coverage details.
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
type required | string | Type of action: 'withdraw' to withdraw from assignment or 'edit-coverage' to edit coverage. One of: |
id required | string | Unique identifier of the assignment. Example |
Every call also sends Authorization and X-Tenant-ID; see Getting started.
Request body
| Field | Type | Description |
|---|---|---|
removeSlots | array of object | Slots the provider is giving up. Read with type=edit-coverage. type=withdraw ignores it and withdraws the provider from every slot. |
removeSlots[].slotId | integer | Required when type=edit-coverage. Example |
removeSlots[].locationTypeId | integer | Required when type=edit-coverage. Example |
removeSlots[].providerTypeId | integer or null | Example |
removeSlots[].assignmentProviderId | integer or null | Example |
Example
{
"removeSlots": [
{
"slotId": 41,
"locationTypeId": 12,
"providerTypeId": 3,
"assignmentProviderId": 88
}
]
}Example request
curl -X PATCH "https://api.fetchfido.ai/v1/settings/portal/provider/assignment/{type}/{id}" \
-H "Authorization: Bearer $FIDO_API_KEY" \
-H "X-Tenant-ID: $FIDO_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{"removeSlots":[{"slotId":41,"locationTypeId":12,"providerTypeId":3,"assignmentProviderId":88}]}'Try it
Responses
200 Assignment action completed successfully
Assignment action completed successfully
{
"success": true,
"message": "Assignment withdraw successully"
}Response fields (2)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
401 Not signed in
Unauthorized - Authentication required
{
"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
The authenticated provider has no relationship to this assignment/shift (never invited, never assigned) — generic message 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. For type=edit-coverage, each removeSlots entry's slotId, locationTypeId and providerTypeId are cross-referenced against the assignment/shift named in {id} — a real id that belongs to a different assignment is rejected here, not silently written against the wrong one.
{
"success": false,
"message": "Validation failed",
"errors": {
"removeSlots.0.slotId": [
"This slot does not belong to this assignment."
]
}
}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
{
"success": false,
"message": "Failed to withdraw assignment"
}Response fields (2)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |