Prompt
interview scheduling API with timezone support
Latest observation
Oct 16, 2026
OpenAI APIWeb search: off
Here’s a solid design for an Interview Scheduling API with timezone support.
Core goals
- Let candidates/interviewers pick times in their local timezone
- Store times consistently in UTC
- Avoid DST bugs and ambiguous/non-existent local times
- Support meeting creation, availability checking, rescheduling, and cancellation
Recommended rules
- Client sends local datetime + timezone
- Example:
{ "startLocal": "2026-03-10T09:00:00", "timeZone": "America/Los_Angeles" }
- Example:
- Server validates and converts to UTC
- Store:
start_at_utcend_at_utc- original
time_zone
- Store:
- Always return both UTC and localized display time
- Use IANA time zone IDs only
- Good:
America/New_York,Europe/London - Avoid offsets only like
-05:00because they don’t handle DST correctly
- Good:
- Reject ambiguous or invalid local times
- Example DST gap:
2026-03-08 02:30inAmerica/New_Yorkmay not exist - Example DST overlap:
2026-11-01 01:30may map to two different UTC instants
- Example DST gap:
Data model
Interview
{
"id": "int_123",
"candidateId": "cand_456",
"interviewerId": "usr_789",
"startAtUtc": "2026-03-10T16:00:00Z",
"endAtUtc": "2026-03-10T16:30:00Z",
"timeZone": "America/Los_Angeles",
"status": "scheduled",
"createdAt": "2026-02-01T12:00:00Z",
"updatedAt": "2026-02-01T12:05:00Z"
}
Availability window
{
"userId": "usr_789",
"dayOfWeek": 2,
"startLocal": "09:00",
"endLocal": "17:00",
"timeZone": "America/New_York"
}
API endpoints
1. Create interview
POST /interviews
Request
{
"candidateId": "cand_456",
"interviewerId": "usr_789",
"startLocal": "2026-03-10T09:00:00",
"durationMinutes": 30,
"timeZone": "America/Los_Angeles"
}
Response
{
"id": "int_123",
"startAtUtc": "2026-03-10T16:00:00Z",
"endAtUtc": "2026-03-10T16:30:00Z",
"timeZone": "America/Los_Angeles",
"status": "scheduled"
}
2. Get interview
GET /interviews/{id}
Response
{
"id": "int_123",
"candidateId": "cand_456",
"interviewerId": "usr_789",
"startAtUtc": "2026-03-10T16:00:00Z",
"endAtUtc": "2026-03-10T16:30:00Z",
"timeZone": "America/Los_Angeles",
"startLocal": "2026-03-10T09:00:00",
"endLocal": "2026-03-10T09:30:00",
"status": "scheduled"
}
3. Check availability
GET /availability?userId=usr_789&date=2026-03-10&timeZone=America/Los_Angeles
Response
{
"date": "2026-03-10",
"timeZone": "America/Los_Angeles",
"availableSlots": [
{
"startLocal": "2026-03-10T09:00:00",
"endLocal": "2026-03-10T09:30:00"
}
]
}
4. Reschedule interview
PATCH /interviews/{id}/reschedule
Request
{
"startLocal": "2026-03-11T10:00:00",
"durationMinutes": 30,
"timeZone": "Europe/London"
}
Response
{
"id": "int_123",
"startAtUtc": "2026-03-11T10:00:00Z",
"endAtUtc": "2026-03-11T10:30:00Z",
"timeZone": "Europe/London",
"status": "scheduled"
}
5. Cancel interview
DELETE /interviews/{id} or POST /interviews/{id}/cancel
Important timezone handling logic
Convert local to UTC
Pseudo:
input: local datetime, timeZone
1. parse local datetime
2. resolve against IANA zone rules
3. if invalid/non-existent -> return 400
4. if ambiguous -> require disambiguation or return 400
5. convert to UTC
6. store UTC + original timeZone
Handle DST ambiguity
For overlap times, you may need:
{
"startLocal": "2026-11-01T01:30:00",
"timeZone": "America/New_York",
"fold": 1
}
If you want to keep the API simpler, return an error and ask the client to pick a different time.
Suggested validations
timeZonemust be valid IANA zone- local start time must be within business hours
- duration must be positive and within allowed range
- start must not overlap existing interviews
- interviewer and candidate availability must both match
- disallow non-existent/ambiguous local datetimes unless explicitly resolved
Best practices
- Store timestamps in UTC in the database
- Store the original timezone as metadata
- Use a timezone-aware library:
- JavaScript: Luxon, date-fns-tz, Temporal (when available)
- Python: zoneinfo, pendulum
- Java: java.time
- .NET: NodaTime
- Include timezone in all user-facing date/time responses
- Test DST transitions thoroughly
Example error response
{
"error": "INVALID_LOCAL_TIME",
"message": "2026-03-08T02:30:00 does not exist in America/New_York due to daylight saving time transition."
}
If you want, I can also provide:
- a full OpenAPI spec
- a PostgreSQL schema
- a Node.js/Express implementation
- a Python/FastAPI implementation