6.7 KiB
Crewli API Contract
Base path: /api/v1/
Auth: Bearer token (Sanctum)
Auth
POST /auth/loginPOST /auth/logoutGET /auth/me
Organisations
GET /organisations— list (super admin)POST /organisations— createGET /organisations/{org}— showPUT /organisations/{org}— updateGET /organisations/{org}/members— membersPOST /organisations/{org}/invite— invite user
Events
GET /organisations/{org}/events— list (top-level only by default)GET /organisations/{org}/events?include_children=true— include sub-events nested in responseGET /organisations/{org}/events?type=festival— filter by event_type (festival|series|event)POST /organisations/{org}/events— create (supportsparent_event_idfor sub-events)GET /organisations/{org}/events/{event}— detail (includes children and parent if loaded)PUT /organisations/{org}/events/{event}— update (does NOT acceptstatus— use transition endpoint)POST /organisations/{org}/events/{event}/transition— change event status via state machine (see below)GET /organisations/{org}/events/{event}/children— list sub-events of a festival/series
Event Status Transitions
POST /organisations/{org}/events/{event}/transition
Body: { "status": "published" }
Enforces a state machine: only valid forward (and select backward) transitions are allowed.
Returns 422 with errors, current_status, requested_status, and allowed_transitions when the transition is invalid or prerequisites are missing.
Prerequisites checked:
→ published: name, start_date, end_date required→ registration_open: at least one time slot and one section required
Festival cascade: Transitioning a festival parent to showday, teardown, or closed automatically cascades to all children in an earlier status.
EventResource includes allowed_transitions (array of valid next statuses) so the frontend knows which buttons to show.
Crowd Types
GET /organisations/{org}/crowd-typesPOST /organisations/{org}/crowd-typesPUT /organisations/{org}/crowd-types/{type}DELETE /organisations/{org}/crowd-types/{type}
Companies
GET /organisations/{org}/companiesPOST /organisations/{org}/companiesPUT /organisations/{org}/companies/{company}DELETE /organisations/{org}/companies/{company}
Section Categories
GET /organisations/{org}/section-categories— distinct categories used across the organisation's events (for autocomplete). Returns{ "data": ["Bar", "Podium", ...] }
Festival Sections
GET /events/{event}/sectionsPOST /events/{event}/sectionsPUT /events/{event}/sections/{section}DELETE /events/{event}/sections/{section}POST /events/{event}/sections/reorder
Festival context:
{event}can be a festival parent or a sub-event. On a festival parent, sections are for operational planning (build-up, teardown). For sub-events,GETautomatically includescross_eventsections from the parent festival. Shifts on cross_event sections must use the parent festival's event_id in API calls, since the section'sevent_idpoints to the parent.
Time Slots
GET /events/{event}/time-slotsPOST /events/{event}/time-slotsPUT /events/{event}/time-slots/{timeSlot}DELETE /events/{event}/time-slots/{timeSlot}
Festival context:
{event}can be a festival parent or a sub-event. Festival-level time slots (operational: build-up, teardown, transitions) are separate from sub-event time slots (program-specific).
GET /events/{event}/time-slotsreturns only the specified event's own time slots by default. For sub-events, pass?include_parent=trueto also include the parent festival's time slots — each time slot is marked with asourcefield (sub_eventorfestival) and includesevent_namefor display grouping. This parameter has no effect on festivals or flat events.Shifts on sub-event sections may reference parent festival time slots (e.g. for build-up shifts). The
time_slot_idvalidation accepts time slots from the sub-event itself or its parent festival.
Shifts
GET /events/{event}/sections/{section}/shiftsPOST /events/{event}/sections/{section}/shiftsPUT /events/{event}/sections/{section}/shifts/{shift}DELETE /events/{event}/sections/{section}/shifts/{shift}POST /events/{event}/sections/{section}/shifts/{shift}/assignPOST /events/{event}/sections/{section}/shifts/{shift}/claim
Festival context: When managing shifts on a
cross_eventsection, the{event}in the URL must be the parent festival's ID (matchingsection.event_id), not the sub-event's ID.
Persons
GET /events/{event}/personsPOST /events/{event}/personsGET /events/{event}/persons/{person}PUT /events/{event}/persons/{person}POST /events/{event}/persons/{person}/approveDELETE /events/{event}/persons/{person}
Crowd Lists
GET /events/{event}/crowd-listsPOST /events/{event}/crowd-listsPUT /events/{event}/crowd-lists/{list}DELETE /events/{event}/crowd-lists/{list}POST /events/{event}/crowd-lists/{list}/personsDELETE /events/{event}/crowd-lists/{list}/persons/{person}
Locations
GET /events/{event}/locationsPOST /events/{event}/locationsPUT /events/{event}/locations/{location}DELETE /events/{event}/locations/{location}
Person Tags (Organisation Settings)
GET /organisations/{org}/person-tags— list active tags (ordered)POST /organisations/{org}/person-tags— create tagPUT /organisations/{org}/person-tags/{tag}— update tagDELETE /organisations/{org}/person-tags/{tag}— deactivate tag (soft: setsis_active = false)GET /organisations/{org}/person-tag-categories— distinct categories for autocomplete
User Tag Assignments
GET /organisations/{org}/users/{user}/tags— list all tags for user in organisationPOST /organisations/{org}/users/{user}/tags— assign a tagDELETE /organisations/{org}/users/{user}/tags/{tagAssignment}— remove assignmentPUT /organisations/{org}/users/{user}/tags/sync— sync tags by source
Sync endpoint: Replaces tags of the specified
sourceonly. Body:{ "tag_ids": ["ulid1", "ulid2"], "source": "self_reported" }Removesself_reportedtags not in the list, adds new ones, leavesorganiser_assigneduntouched (and vice versa).
Person list tag filtering
GET /events/{event}/persons?tag={person_tag_id}— filter persons by single tagGET /events/{event}/persons?tags=ulid1,ulid2— filter persons by multiple tags (AND logic: must have all)
(Extend this contract per module as endpoints are implemented.)