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

NameTypeDescription
type requiredstring

Type of action: 'withdraw' to withdraw from assignment or 'edit-coverage' to edit coverage.

One of: withdraw, edit-coverage. Example withdraw.

id requiredstring

Unique identifier of the assignment.

Example ASG-23RT45.

Every call also sends Authorization and X-Tenant-ID; see Getting started.

Request body

FieldTypeDescription
removeSlotsarray 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[].slotIdinteger

Required when type=edit-coverage.

Example 41.

removeSlots[].locationTypeIdinteger

Required when type=edit-coverage.

Example 12.

removeSlots[].providerTypeIdinteger or null

Example 3.

removeSlots[].assignmentProviderIdinteger or null

Example 88.

Example

JSON
{
  "removeSlots": [
    {
      "slotId": 41,
      "locationTypeId": 12,
      "providerTypeId": 3,
      "assignmentProviderId": 88
    }
  ]
}

Example request

Shell
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

JSON
{
  "success": true,
  "message": "Assignment withdraw successully"
}
Response fields (2)
FieldTypeDescription
successboolean

Example true.

messagestring

Example Assignment withdraw successully.

401 Not signed in

Unauthorized - Authentication required

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

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.

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

JSON
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "removeSlots.0.slotId": [
      "This slot does not belong to this assignment."
    ]
  }
}
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

JSON
{
  "success": false,
  "message": "Failed to withdraw assignment"
}
Response fields (2)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Failed to withdraw assignment.