Concurrency, Limits & Errors
Calendar is in private beta in US production (api.agentmail.to). The beta is
not available in EU production (api.agentmail.eu). Organizations without
access receive a 403 with the message Calendar access is not enabled for this organization. Email support@agentmail.to
to request access. Upgrade to the latest Python or TypeScript SDK to use the
calendar methods.
ETags and If-Match
Every calendar, event and date has an etag that changes whenever it does. Get, create, update and respond responses, and deletes that cancel dates, return it in the body as etag and in the ETag header. Deleting a one-off or series event returns only a deletion_id.
If-Match is optional on Update Calendar, Update Event, Delete Event and Respond to Event:
- Without it, the change applies to the resource as it is when the request arrives. If another change lands while your request is running, you get
409race_condition; retry. - With it, the change applies only if the resource still has that
etag. Otherwise you get412precondition_failedand nothing changes.
Send If-Match when your change depends on what you read, for example when you replace attendees with a list built from the current one, so you don’t overwrite a response that arrived in the meantime. Take the etag from a read with consistency=primary (or from your last write), since a regional read can be a few seconds old.
Changing one date changes the etag of every date of that series, and so does changing the series. Use the etag of the exact thing you are changing, from your latest read or write. Weak validators (W/"rv-5"), which some proxies produce, are accepted. If-Match: * matches any current version, the same as sending no If-Match.
Handling 412
A 412 precondition_failed body includes current_revision. Read the resource again, decide whether your change still makes sense, and retry with the new etag:
Read with consistency="primary" before retrying, so you do not get a slightly stale copy and fail again.
Retrying safely
Limits
For recurrence limits, see Recurring Events. Calendar requests count toward your API rate limits like any other request.
Send limits for invitations
Invitation, update, cancellation and reply emails also count toward your organization, pod and inbox send limits, one send per recipient. The charge is taken when you make the request, before anything is saved, so an over-limit request returns 429 rate_limit_exceeded and changes nothing. See Send limits.
Retention
The record of each date, including its start and end webhook outcome, is kept for 30 days after the date ends (for a date cancelled with DELETE, 30 days after the cancel). Reading or changing an older date returns 410 event_expired. One-off and series events themselves are kept until you delete them.
Errors
Calendar errors use the standard error format, with a stable code to branch on and a fix that says what to do next.
