Error Handling
Error Handling
Every error response from the Slotflow API follows a consistent format:
code— machine-readable error identifier (use this in your agent’s logic)message— human-readable description (useful for logging, not for parsing)status— HTTP status code (matches the response status)
Error reference
UNAUTHORIZED (401)
When: Missing or invalid API key in the Authorization header.
Agent strategy: Check that you’re passing the API key correctly. This is never a transient error — don’t retry.
NOT_FOUND (404)
When: The resource doesn’t exist, belongs to another organization, or (for humans) has been soft-deleted.
Agent strategy: Verify the ID is correct. If the human was recently deleted (soft delete), they won’t appear in API responses anymore.
SLOT_UNAVAILABLE (409)
When: Another booking was created for the same time slot between your agent’s GET /slots call and your POST /bookings call. This is a race condition — it’s expected in high-volume environments.
Agent strategy: This is the most important error to handle. Retry with the next available slot:
INVALID_DURATION (422)
When: The duration parameter doesn’t match any of the human’s configured meeting_durations.
Agent strategy: Fetch the human to check their allowed durations, then retry with a valid one:
OUTSIDE_WORKING_HOURS (422)
When: The booking slot falls outside the human’s working days or hours, and no open override covers it.
Agent strategy: This should rarely happen if your agent uses the GET /slots endpoint first. The slots endpoint only returns valid times. If you see this error, it means the agent is trying to book a time directly without checking slots.
SCHEDULE_BLOCKED (422)
When: The booking slot overlaps with a block override (vacation, recurring meeting, etc.).
Agent strategy: Same as OUTSIDE_WORKING_HOURS — use GET /slots first, which already filters out blocked times.
LIMIT_REACHED (402)
When: Your organization has used all its monthly booking quota.
How limits work by plan:
Agent strategy: On free plans, inform the user their limit is reached. On paid plans, suggest enabling auto-purchase in the dashboard.
VALIDATION_ERROR (422)
When: Missing or malformed fields in the request body.
Agent strategy: Check the message field — it tells you which fields are missing or invalid. This is a developer error, not a runtime error.
Best practices for AI agents
- Always use
GET /slotsbeforePOST /bookings— this prevents most OUTSIDE_WORKING_HOURS and SCHEDULE_BLOCKED errors - Handle 409 with retry logic — slot conflicts are expected, not exceptional
- Check error
code, notmessage— messages may change, codes are stable - Log errors with context — include the human_id, requested time, and error code for debugging
- Don’t retry on 401, 404, or 422 — these are not transient errors