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
| Field | Type | Description |
|---|---|---|
acknowledge_conflicts | boolean | Send true after the provider has confirmed a schedule conflict (409 provider_conflict_confirmation_required). Also accepted inside requestAssignment, as 1/true. Example |
requestAssignment required | object | |
requestAssignment.assignmentId required | string | Example |
requestAssignment.acceptSlots | array of object | |
requestAssignment.acceptSlots[].id required | integer | Example |
requestAssignment.acceptSlots[].locationTypeId required | integer | Example |
requestAssignment.acceptSlots[].slotId required | integer | Example |
requestAssignment.acceptSlots[].status required | string | Example |
Example
{
"acknowledge_conflicts": false,
"requestAssignment": {
"assignmentId": "ASG-JSPYP1",
"acceptSlots": [
{
"id": 107,
"locationTypeId": 112,
"slotId": 92,
"status": "assigned"
}
]
}
}Example request
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
{
"success": true,
"message": "Assigned assignment successfully.",
"data": {
"id": "ASG-JSPYP1"
}
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
data | object | |
data.id | string | Example |
400 Bad request
Bad Request
{
"success": false,
"message": "Failed to accept slots.",
"errors": {
"acceptSlots": [
"The acceptSlots field is required."
]
}
}Response fields (3)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | object |
401 Not signed in
Missing, invalid or expired API key.
{
"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 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.
{
"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)
| 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 |
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.
{
"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)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
code | string | Example |
errors | object or null | Present only for provider_conflict_confirmation_required |
errors.conflicts | array of object | |
errors.conflicts[].kind | string | One of: |
errors.conflicts[].type | string | One of: |
errors.conflicts[].id | string | Example |
errors.conflicts[].title | string or null | Example |
errors.conflicts[].startsAt | string (date-time) | Example |
errors.conflicts[].endsAt | string (date-time) | Example |
errors.conflicts[].message | string |
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
Server Error
{
"success": false,
"message": "Something went wrong!",
"errors": "Unexpected server error"
}Response fields (3)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | string or null | Null in production. The exception message only when the application runs with debug on. Example |