Ir al contenido

Get Availability

Ver como Markdown
GET
/public/v1/availability
curl --request GET \
--url 'https://api.aymaragents.com/public/v1/availability?from=2026-04-15&to=2026-04-15' \
--header 'X-API-Key: <X-API-Key>'

Return one employee’s free slots within [from, to] (SPEC_API_PUBLICA.md §2.4) – SAME contract as the internal GET /availability (features/appointments.py:148).

userId omitted resolves via SchedulingEligibilityService.resolve_target_employee (tenant-wide “any agendable employee” policy, same as the internal route with no conversation context) – 404 BookableEmployee when nobody in the tenant is agendable. userId given resolves (id, tenant_id) – foreign/unknown -> 404.


Permiso necesario: tenant:appointments.read

from
required
From
string format: date
to
required
To
string format: date
userId
Any of:
string format: uuid

Successful Response

Media typeapplication/json
PublicAvailabilityOut

GET /public/v1/availability response – same shape as the internal AvailabilityOut.

object
slots
required
Slots
Array<object>
PublicSlotOut

One discrete, currently-free window (GET /public/v1/availability’s slots entries) – same shape as the internal SlotOut.

object
startsAt
required
Startsat
string format: date-time
endsAt
required
Endsat
string format: date-time
degraded
required
Degraded
boolean
degradedReason
Any of:
string

Examplegenerated

{
"slots": [
{
"startsAt": "2026-04-15T12:00:00Z",
"endsAt": "2026-04-15T12:00:00Z"
}
],
"degraded": true,
"degradedReason": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Examplegenerated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}