Date resolver (Crono)
Turn what a customer said about dates, such as "next Tuesday at 2pm", into an exact date and time.
Customers rarely give exact dates. They say "tomorrow afternoon", "next Monday", "on the 15th" or "every Monday". Crono reads the dialogue and returns the date and time they meant, ready for a calendar or a booking system.
It considers:
- The reference date: "tomorrow" depends on when the conversation happened.
- Time zone and default time: when the customer gives a day but no time, a default time is used and the answer says so.
- Business days and holidays: by country and state.
- Recurrence: "every Monday" comes back as a repeating rule.
Crono understands Portuguese. When it is not confident, it does not guess: the date comes back empty and you can ask the customer to confirm.
ReferenceTechnical details
POST /api/externalAPIs/public/dateResolverFromDialogue with a host token (Authorization: Bearer $TOLKY_TOKEN).
| Name | Type | Required | Description |
|---|---|---|---|
dialogue | string or array | Yes | The customer's text, or a list of { "role", "content" } messages (role is user, assistant or system). |
nowISO | string | No | Reference date and time, ISO 8601. Default: now. |
options.tz | string | No | Time zone. Default America/Sao_Paulo. |
options.defaultTime | string | No | Time used when none is mentioned. Default 09:00. |
options.holidaysCountry | string | No | Country for holidays, for example BR. |
options.holidaysState | string | No | State for regional holidays, for example SP. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/dateResolverFromDialogue" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dialogue": "Pode marcar para terça que vem às 14h?",
"nowISO": "2026-03-05T10:00:00-03:00",
"options": { "tz": "America/Sao_Paulo", "defaultTime": "09:00", "holidaysCountry": "BR", "holidaysState": "SP" }
}'{
"code": 200,
"message": "OK",
"data": {
"extraction": { "relative": "...", "explicit_time": "14:00", "confidence_score": 92 },
"resolved_date": "terça, 10/03/2026 14:00",
"resolution": {
"kind": "single",
"start_local": "2026-03-10T14:00:00-03:00",
"start_utc": "2026-03-10T17:00:00.000Z",
"tz": "America/Sao_Paulo",
"assumed_time": false,
"needs_confirmation": false
},
"insights": { },
"trust": { "score": 90, "reason": "..." },
"realtime_instruction": "..."
}
}| Field | Description |
|---|---|
resolution.kind | single for one date, recurrence for a repeating rule. |
resolution.start_local | Date and time in the chosen time zone, with offset. |
resolution.start_utc | The same moment in UTC. |
resolution.assumed_time | true when no time was said and defaultTime was used. |
resolution.needs_confirmation | true when the request was ambiguous. ambiguity_reason explains. Confirm with the customer. |
resolved_date | Friendly text in Portuguese, or null when nothing was resolved. |
extraction | What was understood from the dialogue, including confidence_score. |
trust | score and reason of the final result. |
realtime_instruction | A short summary in Portuguese, ready to give to the avatar, or null. |
Errors
Crono answers HTTP 200 even when it cannot resolve a date. Check the body:
error: "invalid_payload"whendialogueis missing or empty.errorwith a reason when the analysis failed.resolved_date: nullwhen there was no date in the dialogue or confidence was too low.
Unexpected failures answer 500.