Skip to content
Go to app

Batch

Open in ChatGPT

For imports and bulk edits, send up to 100 operations in one call.

POST /v1/publisher/calendars/{calendar_id}/events/batch
Terminal window
curl https://api.kalender-sync.de/v1/publisher/calendars/$KS_CAL/events/batch \
-H "Authorization: Bearer $KS_KEY" \
-H "Content-Type: application/json" \
-d '{
"operations": [
{ "method": "PUT", "external_id": "wp-1482", "event": { "title": "Sunset Yoga", "start": "2026-11-12T18:00:00" } },
{ "method": "PUT", "external_id": "wp-1490", "event": { "title": "", "start": "2026-11-13T18:00:00" } },
{ "method": "DELETE", "external_id": "wp-1311" }
]
}'
FieldRules
operations1 to 100 entries
operations[].methodPUT (create or update) or DELETE
operations[].external_idas with the single PUT
operations[].eventfor PUT: the event, with the same fields as the single PUT
sync_idoptional: assigns the operations to a full sync

The request body may be up to 1 MB.

Always 200 OK as long as the call itself is valid. The result of each operation is in results, in the same order:

{
"results": [
{ "external_id": "wp-1482", "status": 201, "changed": true, "sequence": 0 },
{
"external_id": "wp-1490",
"status": 400,
"error": {
"code": "invalid_request",
"errors": [{ "field": "title", "code": "too_small", "message": "String must contain at least 1 character(s)" }]
}
},
{ "external_id": "wp-1311", "status": 204 }
]
}
statusMeaning
201Event created
200Event updated or unchanged (changed: false)
204Event deleted (or already gone)
4xxThis operation failed; details in error.code, error.message, error.errors

Possible error codes per operation: invalid_request, invalid_external_id, event_limit_reached.

  • Operations run in order. A failing operation does not stop the others, so check every result.
  • A batch is not a transaction. If the connection drops, some operations may already be done. Just send the batch again: PUT and DELETE are idempotent.
  • The feed is updated once after the batch, not per operation.
  • Each batch counts as one request for the rate limit. That makes batch the right tool for imports.

Errors that affect the whole call (key, calendar, more than 100 operations, body too large, sync expired) come as a normal problem response with an HTTP status. → Errors