Write many events at once

Applies a batch of event changes in one request, mirroring the pages batch. Everything lands or nothing does.

POST https://sitepaste.com/api/v1/public/sites/{siteId}/events/batch

Requires the content scope.

An entry with an id updates that event, and one without creates a new event. Ids come from the list. deleteIds names events to delete in the same call. To create a single event, use POST /sites/{siteId}/events.

Usage

curl -X POST https://sitepaste.com/api/v1/public/sites/default/events/batch \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "title": "Morning Breathwork",
        "startsAt": "2026-09-01T09:00",
        "timezone": "America/Los_Angeles",
        "eventTypeSlugs": ["breathwork"],
        "price": "$25",
        "bookingUrl": "https://example.com/book"
      },
      { "id": "4ghjanhpo9sy", "hidden": true }
    ],
    "deleteIds": ["e9q2xv7m4r8t"]
  }'

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Body

FieldTypeRequiredDescription
eventsarrayOne of events/deleteIdsUp to 1000 entries; see the fields below.
deleteIdsarrayOne of events/deleteIdsUp to 1000 event ids to delete. An unknown id fails the request.

The request body may be up to 16 MB, and a larger one is refused with 413.

The site is named in the path, not the body. See addressing. Publish your changes with POST /sites/{siteId}/deployments once the batch has landed.

Entry fields

An entry takes the same fields the single create takes, plus id.

FieldTypeRequiredDescription
idstringNoEvent ID (short ID). Present updates that event; absent creates one.

Creates require title, startsAt, and timezone. On updates, absent fields keep their stored values.

No two parts of one request may address the same event. An id cannot appear twice in events, cannot appear twice in deleteIds, and an id in events cannot also appear in deleteIds. Any of these refuses the whole batch, and nothing is written.

Response

{
  "events": [
    { "id": "4ghjanhpo9sy", "title": "Morning Breathwork", "status": "created" }
  ],
  "deleted": 1
}

Validation failures return 422 with problems keyed by entry index:

{ "error": "validation failed", "code": "validation_failed", "events": { "0": { "timezone": "invalid timezone" } } }

See errors.