Skip to main content

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.

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 URLhttps://api.xapp.ai/availability/v1
AuthenticationAuthorization: Bearer <availability key> on every request
FormatJSON responses; every parameter is a query string parameter
Rate limit20 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:

KeyScopeWhat it can read
A business's own API keyread:availabilityThe windows and services of that one business. Asking for another business returns 404.
A search keysearch:availabilityAny 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 pathWhat it doesScope
GET /businesses/{appId}/windowsArrival windows one business offersread:availability or search:availability
GET /businesses/{appId}/servicesThe services (availability classes) a business takes bookings forread:availability or search:availability
GET /windows/searchOpen windows across businesses, by place and servicesearch:availability

appId is the business's id in XAPP AI.

Windows for one business​

GET /businesses/{appId}/windows

ParameterDescription
fromFirst day, YYYY-MM-DD, in the business's time zone. Defaults to today there.
toLast day, YYYY-MM-DD, inclusive. Defaults to 14 days in all (from plus 13). The range can be at most 62 days.
classIdOnly these services: one or more class ids from /services, comma-separated.
serviceFree text describing the job, such as leaking sink. Windows are narrowed to the services that match it.
originWho 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"
}
]
}
FieldDescription
businessIdThe business asked for.
timeZoneThe business's IANA time zone.
asOfWhen the answer was computed (the time of your request).
windows[].start, windows[].endThe arrival window, ISO 8601 with the business's offset.
windows[].statusopen, or limited when only one booking is left.
windows[].basisAlways policy: the window comes from the business's settings, not a live calendar.
windows[].confirmationAlways business_confirms: the business confirms each booking.
windows[].classIdThe service the window is for. A business offering several services returns one entry per window per service.
windows[].remainingBookings left in the window. Present only when the business caps bookings.
windows[].bookingUrlThe 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)

ParameterDescription
zipA US ZIP code to search around.
lat, lngCoordinates to search around. Give both or neither.
radiusMilesDistance from lat/lng, 0 to 100. Defaults to 25.
verticalThe kind of business, such as plumbing.
service, classIdAs for one business.
from, toAs for one business, read in each business's own time zone.
earliesttrue to return only each business's soonest window.
limitResults per page, 1 to 100. Defaults to 20.
cursorThe nextCursor from the previous page.
originAs 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. remaining goes 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." }
StatusMeaning
400A 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.
401No Authorization: Bearer header, or the key is not valid or was revoked. The body is {"message":"Unauthorized"}.
403The key doesn't have the scope for this endpoint, for example a business key calling search.
404App not found. for an unknown business or one your key can't read, or Availability is not offered for this business. (see above).
429Too many requests. Wait a second and retry, backing off further if it repeats.
500Something went wrong on our side. Retry later.