API reference › Requests › Provider portal

Accept assignment slots for a request

POST /v1/portal/provider/requests

Scope
requests:write
Roles
service-provider

Assigns the provider to selected slots of an assignment and returns the status with accepted slots.

Parameters

None of its own.

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

Request body required

FieldTypeDescription
acknowledge_conflictsboolean

Send true after the provider has confirmed a schedule conflict (409 provider_conflict_confirmation_required). Also accepted inside requestAssignment, as 1/true.

Example false.

requestAssignment requiredobject
requestAssignment.assignmentId requiredstring

Example ASG-JSPYP1.

requestAssignment.acceptSlotsarray of object
requestAssignment.acceptSlots[].id requiredinteger

Example 107.

requestAssignment.acceptSlots[].locationTypeId requiredinteger

Example 112.

requestAssignment.acceptSlots[].slotId requiredinteger

Example 92.

requestAssignment.acceptSlots[].status requiredstring

Example assigned.

Example

JSON
{
  "acknowledge_conflicts": false,
  "requestAssignment": {
    "assignmentId": "ASG-JSPYP1",
    "acceptSlots": [
      {
        "id": 107,
        "locationTypeId": 112,
        "slotId": 92,
        "status": "assigned"
      }
    ]
  }
}

Example request

Shell
curl -X POST "https://api.fetchfido.ai/v1/portal/provider/requests" \
  -H "Authorization: Bearer $FIDO_API_KEY" \
  -H "X-Tenant-ID: $FIDO_TENANT_ID" \
  -H "Content-Type: application/json" \
  -d '{"acknowledge_conflicts":false,"requestAssignment":{"assignmentId":"ASG-JSPYP1","acceptSlots":[{"id":107,"locationTypeId":112,"slotId":92,"status":"assigned"}]}}'

Try it

Responses

200 Assigned assignment successfully

Assigned assignment successfully

JSON
{
  "success": true,
  "message": "Assigned assignment successfully.",
  "data": {
    "id": "ASG-JSPYP1"
  }
}
Response fields (4)
FieldTypeDescription
successboolean

Example true.

messagestring

Example Assigned assignment successfully..

dataobject
data.idstring

Example ASG-JSPYP1.

400 Bad request

Bad Request

JSON
{
  "success": false,
  "message": "Failed to accept slots.",
  "errors": {
    "acceptSlots": [
      "The acceptSlots field is required."
    ]
  }
}
Response fields (3)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Failed to accept slots..

errorsobject
401 Not signed in

Missing, invalid or expired API key.

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 requestAssignment.assignmentId (never broadcast to, 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 'requests:write' 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 'requests:write' scope..

errorsany or null

Null on this status.

codestring

Always empty on this status.

Example .

409 Conflict

Nothing was written. Either the offer can no longer be accepted (the slot is filled, the offer lapsed or the work was called off), or (code provider_conflict_confirmation_required) the accept clashes with the provider's own work or settings and they have not confirmed. Resend the same request with acknowledge_conflicts true to accept anyway.

JSON
{
  "success": false,
  "message": "Wait, you're already booked for Assignment Clinic visit (ASG-AB12CD) on Mon, May 5, 2031 9:00 AM–10:00 AM CDT, which overlaps this assignment on Mon, May 5, 2031 9:30 AM–10:30 AM CDT. Accept anyway?",
  "code": "provider_conflict_confirmation_required",
  "errors": {
    "conflicts": [
      {
        "kind": "overlap",
        "type": "assignment",
        "id": "ASG-AB12CD",
        "title": "Clinic visit",
        "startsAt": "2031-05-05T14:00:00Z",
        "endsAt": "2031-05-05T15:00:00Z",
        "message": "string"
      }
    ]
  }
}
Response fields (12)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Wait, you're already booked for Assignment Clinic visit (ASG-AB12CD) on Mon, May 5, 2031 9:00 AM–10:00 AM CDT, which overlaps this assignment on Mon, May 5, 2031 9:30 AM–10:30 AM CDT. Accept anyway?.

codestring

Example provider_conflict_confirmation_required.

errorsobject or null

Present only for provider_conflict_confirmation_required

errors.conflictsarray of object
errors.conflicts[].kindstring

One of: overlap, buffer, unavailable, vacation, limit. Example overlap.

errors.conflicts[].typestring

One of: assignment, shift. Example assignment.

errors.conflicts[].idstring

Example ASG-AB12CD.

errors.conflicts[].titlestring or null

Example Clinic visit.

errors.conflicts[].startsAtstring (date-time)

Example 2031-05-05T14:00:00Z.

errors.conflicts[].endsAtstring (date-time)

Example 2031-05-05T15:00:00Z.

errors.conflicts[].messagestring
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

Server Error

JSON
{
  "success": false,
  "message": "Something went wrong!",
  "errors": "Unexpected server error"
}
Response fields (3)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Something went wrong!.

errorsstring or null

Null in production. The exception message only when the application runs with debug on.

Example Unexpected server error.