Skip to content
campaiDeveloper
campai.com

Booking · Events

POST/{organizationId}/{mandateId}/booking/events/{eventId}/patterns/{patternId}/stop

Stop event pattern

Stops a course event's repeat pattern from the requested date, or from now if that date is in the past. It removes unbooked future dates and either keeps or cancels booked dates, with options for the cancellation reason, refund and attendee notification. Dates that have already started or were canceled remain unchanged. The response contains updated and deleted event IDs.

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 with mandate.read and event.edit permissions.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • eventIdidrequired
  • patternIdstringrequired

    exactly 10 characters

Body

Content-Type: application/json

  • fromstring · date-timerequired
  • bookedDatesobjectrequired
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/patterns/YOUR_PATTERN_ID/stop' \
  --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

Content-Type: application/json

  • updatedid[]
  • deletedid[]
Response200
{
  "updated": [
    "000000000000000000000001"
  ],
  "deleted": [
    "000000000000000000000001"
  ]
}

What else happens

  • The pattern is marked stopped across the course dates. The course dates are renumbered, and their series statistics are updated.
  • When course date positions change, the corresponding attendee course indexes are updated.
  • Course booking wallet pass expiry dates can change, and wallet updates can be requested.
  • Resource reservations for deleted dates are removed; course numbering on remaining reservations can also change.
  • When dates are deleted, their event tag usage counts can decrease.
  • Deleting dates starts booking.deleteEventData jobs after the transaction.
  • Canceling booked dates starts booking.processEventUpdate jobs after the transaction.
  • Deleting dates starts a misc.deleteTodoItems job for their todo items after the transaction.
  • If an event date or title is updated, matching booking records can have their event date or title updated.
  • If waitlist numbers are reserved, the event's waitlist sequence counter is increased by the number reserved.
  • If waitlist numbers are reserved and no sequence exists, a sequence is initialized from the highest historical waitlist number, or zero if there is none.

Errors

Other errors

StatusErrorWhen
400The repeat pattern is already stopped.If the pattern is already stopped, the request returns HTTP 400 with booking.event.stopEventPattern.alreadyStopped.
400Stopping the repeat pattern would remove every date of the course. Delete the course instead.If stopping the pattern would delete every date of the course, the request returns HTTP 400 with booking.event.stopEventPattern.noDatesLeft. Delete the course instead.
400One of the events deleted in the operation cannot be deleted because it has bookings. Please cancel the events first to refund all its bookings.If a future, uncanceled date selected for deletion has an active booking, the request returns HTTP 400 with booking.event.eventMutation.hasBookings.
404The given event was not foundIf the event is not found in the requested organization and mandate, the request returns HTTP 404 with booking.event.eventNotFound.
404The repeat pattern was not found.If the event does not contain the requested repeat pattern, the request returns HTTP 404 with booking.event.getEventCoursePattern.patternNotFound.
404Event was not foundIf an event selected for update cannot be found during the mutation, the request returns HTTP 404 with booking.event.applyEventResourceReservationMutation.eventNotFound.

Errors nearly every request can meet are listed under Errors.