Skip to main content
Many API operations accept date ranges to filter results by time periods. The Guile API uses a flexible date range format that supports both exact dates and open-ended ranges with inclusive or exclusive boundaries.

Date Format

All dates use the YYYY-MM-DD format as specified in RFC 3339. For example, 2024-12-01 represents December 1st, 2024.

Range Syntax

Date ranges use mathematical interval notation with square brackets for inclusive boundaries and parentheses for exclusive boundaries.

Exact Dates

Specify a single date to match that exact day:
2024-12-01
This is equivalent to the inclusive range [2024-12-01,2024-12-01].

Bounded Ranges

Use two dates separated by a comma to specify a range between two dates: Inclusive ranges include both endpoint dates:
[2024-12-01,2024-12-31]
This matches all dates from December 1st through December 31st, including both days. Exclusive ranges exclude both endpoint dates:
(2024-12-01,2024-12-31)
This matches all dates between December 1st and December 31st, but not those specific days. Mixed boundaries combine inclusive and exclusive endpoints:
[2024-12-01,2024-12-31)
This includes December 1st but excludes December 31st.

Open-Ended Ranges

Leave one side of the range empty to create open-ended filters: On or after a date:
[2024-12-01,]
This matches December 1st and all dates after it. After a date (exclusive):
(2024-12-01,)
This matches all dates after December 1st, but not December 1st itself. Before or on a date:
[,2024-12-31]
This matches all dates up to and including December 31st. Before a date (exclusive):
(,2024-12-31)
This matches all dates before December 31st, but not December 31st itself.

Common Use Cases

Current month: Use an inclusive range from the first to the last day of the month. Last 30 days: Calculate the date 30 days ago and use an inclusive range to today. Future appointments: Use an open-ended range starting from today. Historical data: Use an exclusive upper bound to exclude today’s incomplete data.

Validation

Date ranges must follow the specified format and use valid dates. The API validates that:
  • Dates use the correct YYYY-MM-DD format
  • Dates represent valid calendar days
  • The range syntax uses proper bracket and parenthesis notation
  • The total range string doesn’t exceed 24 characters
Invalid date ranges will result in a validation error explaining the specific issue.