Skip to Content
Tools

Resolve a calendar date

Permissiontools:readRetriesIdempotency-Key optionalAuthentication
POST
/dates/resolve

Deterministic Gregorian date arithmetic shared with the resolve_date built-in. Supply an IANA timezone. Empty date arguments return today in that zone at execution time. One anchor: date, day_of_month (optionally month/year), weekday, or today. weekday alongside a date checks the claim before offsets. next/previous weekdays exclude the reference day; on_or_after/on_or_before include it. Missing day/month/year components use the next (or past) valid occurrence including the reference date. Resolve anchor, add calendar months (clamping month-end), then add weeks and days. No booking or business-policy decisions. Clarify ambiguous dates before submitting. reference_date changes the arithmetic anchor; days_from_today still compares with local today.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Header Parameters

Idempotency-Key?string

Optional. When supplied, identical retries replay the saved result. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
timezone*string

IANA timezone, e.g. Asia/Dubai or America/New_York. Required; no phone-number or server-local inference.

Length1 <= length
reference_date?string

Optional arithmetic anchor, Gregorian YYYY-MM-DD. Defaults to local today.

Formatdate
date?string

Explicit valid Gregorian date. Mutually exclusive with date components.

Formatdate
day_of_month?integer
Range1 <= value <= 31
month?integer

Requires day_of_month.

Range1 <= value <= 12
year?integer

Requires month and day_of_month.

Range1 <= value <= 9999
weekday?string

Anchor weekday, or a weekday claim to validate against an explicit date.

Value in"monday""tuesday""wednesday""thursday""friday""saturday""sunday"
occurrence?string

Only for a weekday anchor. Defaults to next, or previous when direction is past.

Value in"next""on_or_after""previous""on_or_before""this_week""next_week""last_week"
direction?string

Direction for incomplete calendar dates and bare weekdays. Does not override an explicit year/date or occurrence.

Default"future"
Value in"future""past"
days?integer
Range-36600 <= value <= 36600
Default0
weeks?integer
Range-5200 <= value <= 5200
Default0
months?integer
Range-1200 <= value <= 1200
Default0
week_starts_on?string
Default"monday"
Value in"monday""tuesday""wednesday""thursday""friday""saturday""sunday"
locale?string

Spoken-date formatting only. The calendar remains Gregorian.

Default"en-US"
Value in"en-US""ar-SA"

Response Body

Resolved date, or weekday_mismatch with a question. A mismatch is not a confirmed date; offsets are not applied.

application/json
  1. response
status*string
Value in"resolved""weekday_mismatch"
resolved_date*string
Formatdate
weekday*string
Value in"monday""tuesday""wednesday""thursday""friday""saturday""sunday"
today*string
Formatdate
reference_date*string
Formatdate
timezone*string
timezone_source*string
Value in"request""organization""configuration""caller""agent"
days_from_today*integer
is_past*boolean
date_spoken*string
adjustments*array<>
expected_weekday?string
Value in"monday""tuesday""wednesday""thursday""friday""saturday""sunday"
question?string
Example Request
curl -X POST 'https://api.kejue.co/v1/dates/resolve' \  -H 'Content-Type: application/json' \  -d '{  "timezone": "string"}'
Example Response
{  "status": "resolved",  "resolved_date": "2019-08-24",  "weekday": "monday",  "today": "2019-08-24",  "reference_date": "2019-08-24",  "timezone": "string",  "timezone_source": "request",  "days_from_today": 0,  "is_past": true,  "date_spoken": "string",  "adjustments": [    "month_end_clamped"  ],  "expected_weekday": "monday",  "question": "string"}