Availability API
The Availability API tells you when a business can come out: the arrival windows it offers over the next days, by service. Each window carries a booking link that opens the business's booking form with that window already chosen. The business confirms every booking itself, so a window is an offer, not a reservation.
- API reference: api.xapp.ai/cms/docs
- OpenAPI spec: api.xapp.ai/cms/openapi.json
The reference is published with the rest of the XAPP AI content API under /cms, and includes the /availability/v1 routes described here.
Basics
| Base URL | https://api.xapp.ai/availability/v1 |
| Authentication | Authorization: Bearer <availability key> on every request |
| Format | JSON responses; every parameter is a query string parameter |
| Rate limit | 20 requests per second per endpoint, bursts up to 40 |
Authentication
Send an API key as a bearer token. A partner key does not work here; the Availability API takes an XAPP AI API key with an availability scope:
| Key | Scope | What it can read |
|---|---|---|
| A business's own API key | read:availability | The windows and services of that one business. Asking for another business returns 404. |
| A search key | search:availability | Any eligible business by its id, and the cross-business search. Search keys belong to an organization and are issued by XAPP AI. |
Contact support@xapp.ai to get a key. Keys created before the Availability API existed don't have the scope and get 403. Keep keys on your servers. A key's permissions are cached for up to 5 minutes, so a revoked key can keep working for that long.
curl "https://api.xapp.ai/availability/v1/businesses/$BUSINESS_ID/windows" \
-H "Authorization: Bearer $AVAILABILITY_KEY"
Endpoints
| Method and path | What it does | Scope |
|---|---|---|
GET /businesses/{appId}/windows | Arrival windows one business offers | read:availability or search:availability |
GET /businesses/{appId}/services | The services (availability classes) a business takes bookings for | read:availability or search:availability |
GET /windows/search | Open windows across businesses, by place and service | search:availability |
appId is the business's id in XAPP AI.
Windows for one business
GET /businesses/{appId}/windows
| Parameter | Description |
|---|---|
from | First day, YYYY-MM-DD, in the business's time zone. Defaults to today there. |
to | Last day, YYYY-MM-DD, inclusive. Defaults to 14 days in all (from plus 13). The range can be at most 62 days. |
classId | Only these services: one or more class ids from /services, comma-separated. |
service | Free text describing the job, such as leaking sink. Windows are narrowed to the services that match it. |
origin | Who is asking, stamped on the booking link: ai_mode, therightpro, rwg or agent. Anything else is recorded as availability_api. |
Days are in the business's own time zone, which the response returns. You can't pass a time zone. There is no duration: a window is a fixed arrival window set by the business (by default 8:00 to 12:00 and 13:00 to 17:00).
curl "https://api.xapp.ai/availability/v1/businesses/app-1/windows?from=2026-11-16&to=2026-11-17&origin=agent" \
-H "Authorization: Bearer $AVAILABILITY_KEY"
{
"businessId": "app-1",
"timeZone": "America/New_York",
"asOf": "2026-11-16T11:00:00.000Z",
"windows": [
{
"start": "2026-11-16T08:00:00-05:00",
"end": "2026-11-16T12:00:00-05:00",
"status": "limited",
"basis": "policy",
"confirmation": "business_confirms",
"classId": "repair",
"remaining": 1,
"bookingUrl": "https://book.xapp.ai/?key=KEY&environment=production&origin=agent&placeId=PLACE&window=2026-11-16T08%3A00%3A00-05%3A00%2F2026-11-16T12%3A00%3A00-05%3A00"
},
{
"start": "2026-11-16T13:00:00-05:00",
"end": "2026-11-16T17:00:00-05:00",
"status": "open",
"basis": "policy",
"confirmation": "business_confirms",
"classId": "repair",
"remaining": 2,
"bookingUrl": "https://book.xapp.ai/?key=KEY&environment=production&origin=agent&placeId=PLACE&window=2026-11-16T13%3A00%3A00-05%3A00%2F2026-11-16T17%3A00%3A00-05%3A00"
}
]
}
| Field | Description |
|---|---|
businessId | The business asked for. |
timeZone | The business's IANA time zone. |
asOf | When the answer was computed (the time of your request). |
windows[].start, windows[].end | The arrival window, ISO 8601 with the business's offset. |
windows[].status | open, or limited when only one booking is left. |
windows[].basis | Always policy: the window comes from the business's settings, not a live calendar. |
windows[].confirmation | Always business_confirms: the business confirms each booking. |
windows[].classId | The service the window is for. A business offering several services returns one entry per window per service. |
windows[].remaining | Bookings left in the window. Present only when the business caps bookings. |
windows[].bookingUrl | The business's booking form, opened with this window chosen. Send the customer here to book. |
In the example, KEY and PLACE stand for the business's form widget key and Google place id, which are public values in any booking link.
Windows are sorted by start, then by service. Windows that have started, are in the past, or are full are left out.
Services of a business
GET /businesses/{appId}/services
{
"businessId": "app-1",
"services": [
{ "id": "repair", "name": "Repair", "summary": "Leaks, clogs" }
]
}
Use an id as classId on the windows request. A business that hasn't set up services returns "services": [], and its windows come back with classId default.
Search across businesses
GET /windows/search (search keys only)
| Parameter | Description |
|---|---|
zip | A US ZIP code to search around. |
lat, lng | Coordinates to search around. Give both or neither. |
radiusMiles | Distance from lat/lng, 0 to 100. Defaults to 25. |
vertical | The kind of business, such as plumbing. |
service, classId | As for one business. |
from, to | As for one business, read in each business's own time zone. |
earliest | true to return only each business's soonest window. |
limit | Results per page, 1 to 100. Defaults to 20. |
cursor | The nextCursor from the previous page. |
origin | As for one business. |
{
"asOf": "2026-11-16T11:00:00.000Z",
"results": [
{
"businessId": "app-1",
"appId": "app-1",
"name": "Example Plumbing",
"timeZone": "America/New_York",
"placeId": "PLACE",
"locationVerified": true,
"distanceMiles": 3.4,
"asOf": "2026-11-16T11:00:00.000Z",
"windows": [ { "start": "2026-11-16T13:00:00-05:00", "end": "2026-11-16T17:00:00-05:00", "status": "open", "basis": "policy", "confirmation": "business_confirms", "classId": "repair", "bookingUrl": "https://book.xapp.ai/?..." } ]
}
],
"nextCursor": "MjA"
}
Results are sorted by earliest window, then distance. nextCursor is left out on the last page. distanceMiles is present only when you searched by lat/lng. Only businesses with a verified location are searched, and at most 100 businesses are considered per search.
Which businesses match a search comes from a search index that updates within moments of a business changing its settings. The windows themselves are always worked out at the time of your request.
Holds
You can't hold or reserve a window through the API. Booking happens on the business's form, through bookingUrl, and the business confirms it.
A business can choose to have its own requests take up capacity, with Hold requested times on its Availability Classes settings. When it does:
- A hold is placed by each lead the business receives that asks for a window. A lead that picks a window holds that window. A lead that picks a time holds the hour from that time. A lead that picks only a day counts against that day's limit. Once the business books the job for a window, that window is held instead.
- A hold ends when the lead is marked lost, when the job is canceled in the business's field service software, or when the window or day has passed. There is no fixed expiry.
- What you see. Held bookings count against the business's limits per window, per service per day, and per business per day.
remaininggoes down; when it reaches zero the window disappears from the response. You don't get an error for a full window.
Without holds turned on, windows show the business's full capacity whatever has been requested.
Businesses that opt out
The Availability API is on for every eligible business. A business can opt out in Studio under Settings > Availability Classes > Partners, by unchecking Offer arrival windows to partners (Google, TheRightPro, AI agents). It takes effect immediately.
For a business that has opted out, the per-business endpoints return 404:
{
"errorType": "HandledError",
"httpStatus": 404,
"message": "Availability is not offered for this business."
}
The same answer comes back for any business that can't take bookings this way: one with no form widget or no verified location (so there is no booking link), one whose plan doesn't include partner booking, or one that has been deleted. Search simply leaves these businesses out.
Errors
Errors from the API have this shape:
{ "errorType": "HandledError", "httpStatus": 400, "message": "The range can be at most 62 days." }
| Status | Meaning |
|---|---|
400 | A parameter is wrong. The message says which: from and to must be YYYY-MM-DD dates., to must not be before from., The range can be at most 62 days., and for search lat and lng must be given together., radiusMiles must be a number from 0 to 100., limit must be a number from 1 to 100. or cursor is not valid. |
401 | No Authorization: Bearer header, or the key is not valid or was revoked. The body is {"message":"Unauthorized"}. |
403 | The key doesn't have the scope for this endpoint, for example a business key calling search. |
404 | App not found. for an unknown business or one your key can't read, or Availability is not offered for this business. (see above). |
429 | Too many requests. Wait a second and retry, backing off further if it repeats. |
500 | Something went wrong on our side. Retry later. |