API reference › Schedule › Assign and availability
Assign service providers to assignment(s) or shift(s)
POST /v1/schedule/assign-provider
- Scope
schedule:read- Roles
- admin, scheduler
Assign one or more service providers to one or more assignments or shifts. Supports multiple service types and location types per provider.
Parameters
None of its own.
Every call also sends Authorization and X-Tenant-ID; see Getting started.
Request body required
Assignment or shift provider assignment payload
| Field | Type | Description |
|---|---|---|
type | string | Type of entity to assign providers to One of: |
assignmentId | array of string | Array of assignment IDs (required if type=assignment) |
shiftId | array of string | Array of shift IDs (required if type=shift) |
assignProviders | array of object | List of providers to assign |
assignProviders[].id | string | Service provider ID Example |
method | string | How providers should be assigned: direct assigns immediately, accept/express-interest place the provider in pending status One of: |
locationType | array of string | Location type(s) to assign the provider under (also accepts a single string). Each service type is assigned under whichever of these locations offers it. When omitted, all assignment/shift locations are considered |
serviceType | array of integer | Service type IDs to assign providers under for this request |
serviceProviderType | array of integer | Service provider type ID(s), e.g. Hearing Interpreter (also accepts a single integer). Each is only applied to the serviceType it actually belongs to, and at most one provider type is assigned per service type |
Example
{
"type": "assignment",
"assignmentId": [
"ASG-XDMSDH"
],
"shiftId": [
"SFT-8Z13C5"
],
"assignProviders": [
{
"id": "SPR-M8F6NP"
}
],
"method": "direct",
"locationType": [
"onsite"
],
"serviceType": [
1
],
"serviceProviderType": [
2
]
}Example request
curl -X POST "https://api.fetchfido.ai/v1/schedule/assign-provider" \
-H "Authorization: Bearer $FIDO_API_KEY" \
-H "X-Tenant-ID: $FIDO_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{"type":"assignment","assignmentId":["ASG-XDMSDH"],"shiftId":["SFT-8Z13C5"],"assignProviders":[{"id":"SPR-M8F6NP"}],"method":"direct","locationType":["onsite"],"serviceType":[1],"serviceProviderType":[2]}'Try it
Responses
201 Providers assigned successfully
Providers assigned successfully
{
"success": true,
"message": "Providers assigned successfully.",
"data": {
"ids": [
"ASG-XDMSDH"
]
}
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
data | object | |
data.ids | array of string | List of assignment or shift IDs that were processed |
400 Bad request
Bad request or missing parameters
{
"success": false,
"message": "Missing assignment/shift ID(s) or providers data.",
"errors": "Invalid Request"
}Response fields (3)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | string | Example |
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
Scope, tenant, IP allow-list or RBAC check failed.
{
"success": false,
"message": "You don't have permission to access this endpoint. This API key is missing the 'schedule:read' 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 |
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": "Something went wrong!",
"errors": "Service provider assignment failed."
}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 |