Skip to content
campaiDeveloper
campai.com

Booking ยท Events

POST/{organizationId}/{mandateId}/booking/events/{eventId}/archive

Archive event

Archives or restores all dates in an event series, using the organization, mandate and event IDs and an archived boolean. A series can be archived only if it has no upcoming active dates. Archived events are hidden from event lists, public pages and the Connect app. The endpoint returns no body.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller needs the mandate.read permission.
  • The caller needs the event.edit permission.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • eventIdidrequired

Body

Content-Type: application/json

  • archivedbooleanrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/events/YOUR_EVENT_ID/archive' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

No response body is specified.

What else happens

  • On success, the endpoint updates archivedAt on all events in the series, setting it to the current time when archiving or null when restoring.

Errors

Other errors

StatusErrorWhen
400Only events whose dates are all over or cancelled can be archived.If archiving is requested and the series has upcoming active dates, the endpoint returns HTTP 400 with key routes.booking.events.archiveEvent.hasUpcomingDates.
404The given event was not foundIf the event is not found, the endpoint returns HTTP 404 with key booking.event.eventNotFound.

Errors nearly every request can meet are listed under Errors.