# MitWare API — full reference

Version 1.10.784. Base URL: `https://{organisation}.mitware.app` (one instance per organisation).

MitWare is the operations platform festivals run their crews, artists, and wiki on. This is the
partner-facing API of **one MitWare instance** — every festival runs its own, so the base URL is the
festival's instance address (for example `https://<festival>.mitware.app`) and every id and every
response is scoped to that festival.

## Authentication

Every call carries a personal or service-account API key: `Authorization: Bearer mw_…`. Keys are
issued by the festival's MitWare administrator (API keys page) — for a person or for a service account. A missing or
invalid key answers `401`.

## Authorization

A key acts as the person it belongs to and can do exactly what that person can do in the app.
Permissions are never granted to a person directly — they come with **memberships**: a role, in a
team, for an event. A permission held in a team also counts in every team below it in the team
hierarchy. Each operation states which permission it requires and in which team and event of the
request it must be held. A call without it answers `403` with `Code: "MissingPermission"` and the
permission's dotted name (for example `Team.Administrate`).

## Errors

Failed calls return JSON with a stable `Code` and a human-readable `Description`, plus structured
fields where useful: `403` for authorization denials, `422` for everything the request itself makes
impossible (unknown ids, closed teams, validation failures).

## Identifiers

Every entity id is a MongoDB ObjectId: 24 hexadecimal characters, for example
`665f2e8a1b2c3d4e5f601234`. Ids are stable within an instance and never reused.

# Team

## POST /api/team/create — Create team

Creates a new team and registers it for the given event.

**Authorization:** requires
- **Team → Administrate** in the global (root) team, for the event named by `EventId` or for all events — *Team name, open admission, max members, parent team, remove from event, delete, create*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (CreateTeamRequest)

- `Name` (string, required) — Name of the new team (used for every supported language)
- `EventId` (EventData id, required) — The event this team belongs to (EventData id)
- `DefaultRoleId` (Role id, required) — Default role assigned to new members of this team (Role id)

### Responses

- **200** `CreateTeamResponse` — OK
  - `TeamId` (Team id, required) — Id of the new team (Team id)
  - `Name` (string, required) — Name of the new team
  - `EventId` (EventData id, required) — The event the team was created for (EventData id)
  - `DefaultRoleId` (Role id, required) — Default role assigned to new members of the team (Role id)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/team/delete — Delete team

Deletes a team. Members lose the membership; the team's shifts and notes are removed with it.

**Authorization:** requires
- **Team → Administrate** in the team named by `TeamId`, for any event — *Team name, open admission, max members, parent team, remove from event, delete, create*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (DeleteTeamRequest)

- `TeamId` (Team id, required) — The team to delete (Team id)

### Responses

- **200** `DeleteTeamResponse` — OK
  - `TeamId` (Team id, required) — Id of the deleted team (Team id)
  - `TeamName` (LocalizedString, required) — Name of the deleted team
    - `Values` (object, optional)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/team/add-member — Add person to teams

Adds a person to one or more teams for an event, assigning the given roles in each team. Adds the event to the person on their first team in it. Partial success: a team the caller may not administrate, a closed team, or a full team is reported in `Failures` while the other teams are still processed.

**Authorization:** requires
- **Team → Administrate** in the team named by `Memberships[].TeamId` for the event named by `EventId` — *Team name, open admission, max members, parent team, remove from event, delete, create*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (AddPersonToTeamsRequest)

- `Memberships` (array of TeamMembershipAssignment, required) — The teams to add the person to, each with the roles to assign in that team
  - `TeamId` (Team id, required) — The team to add the person to (Team id)
  - `RoleIds` (Role id, optional) — Role IDs to assign in this team. Must be non-empty. (Role id)
- `PersonId` (Person id, required) — The person to add as a member (Person id)
- `EventId` (EventData id, required) — The event context (EventData id)

### Responses

- **200** `AddPersonToTeamsResponse` — OK
  - `TeamResults` (array of TeamMembershipResult, required) — One entry per requested membership that succeeded, with the roles newly added and the roles the person already held
    - `TeamName` (LocalizedString, required) — Name of the team
    - `WasTeamNewlyJoined` (boolean, required) — True for a fresh membership, false when the person was already in the team and roles were merged in
    - `NewlyAddedRoleNames` (string, required) — Role names newly assigned by this call, comma-separated; empty when none
    - `AlreadyHadRoleNames` (string, required) — Role names the person already held in this team, comma-separated; empty when none
  - `Failures` (array of AddPersonToTeamFailure, required) — Teams that could not be joined; each carries a stable reason code (TeamClosed, TeamFull, MissingPermission, Other)
    - `TeamName` (LocalizedString, required) — Name of the team that could not be joined
    - `Reason` (string, required) — Stable reason code: TeamClosed, TeamFull, MissingPermission, or Other
  - `WasEffective` (boolean, required) — True if at least one team was newly joined or at least one role was newly added to an existing membership
  - `WasAddedToEvent` (boolean, required) — True if this call also added the event to the person (their first team in this event)
  - `EventName` (string, required) — Display name of the event
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/team/remove-member — Remove team member

Removes a person from a team for an event. Their roles in that team go with the membership.

**Authorization:** requires
- **Team → Administrate** in the team named by `TeamId` for the event named by `EventId` — *Team name, open admission, max members, parent team, remove from event, delete, create*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (RemoveTeamMemberRequest)

- `TeamId` (Team id, required) — The team to remove the member from (Team id)
- `PersonId` (Person id, required) — The person to remove (Person id)
- `EventId` (EventData id, required) — The event this team belongs to (EventData id)

### Responses

- **200** — OK
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/team/set-setting — Set team setting

Patches a team's self-service settings for an event (applications open, admission open, shift swaps, max shifts); null fields stay unchanged. Toggling `IsApplicationOpen` or `IsAdmissionOpen` requires Team → Administrate instead of Manage.

**Authorization:** requires
- **Team → Manage** in the team named by `TeamId` for the event named by `EventId` — *Manage the team, e.g., unlock the shift plan*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SetTeamSettingRequest)

- `TeamId` (Team id, required) — The team whose event-related settings to patch (Team id)
- `EventId` (EventData id, optional) — The event the settings belong to; null = the tenant's default event (EventData id)
- `IsApplicationOpen` (boolean, optional) — Whether the team is offered to applicants; null = unchanged
- `IsAdmissionOpen` (boolean, optional) — Whether members may be added (applications, invite links); null = unchanged
- `AllowsShiftSwaps` (boolean, optional) — Whether members may propose shift swaps; null = unchanged
- `MaxShifts` (integer, optional, nullable) — Maximum shifts a member may hold, 0 = no limit; null = unchanged

### Responses

- **200** `SetTeamSettingResponse` — OK
  - `TeamId` (Team id, required) — The team whose settings were patched (Team id)
  - `EventId` (EventData id, required) — The event the settings belong to (the tenant's default event when the request left it null) (EventData id)
  - `IsApplicationOpen` (boolean, required) — Whether the team is offered to applicants
  - `IsAdmissionOpen` (boolean, required) — Whether members may be added (applications, invite links)
  - `AllowsShiftSwaps` (boolean, required) — Whether members may propose shift swaps
  - `MaxShifts` (integer, required) — Maximum shifts a member may hold, 0 = no limit
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Team note

## POST /api/team-note/set-status — Set team note status

Sets a team note's kanban status (Open / InProgress / Done). Members of the note's own team may always move it; other callers need Team → Manage for that team and event.

**Authorization:** requires
- **Team → Manage** in the team the request refers to for the event the request refers to — *Manage the team, e.g., unlock the shift plan*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SetTeamNoteStatusRequest)

- `TeamNoteId` (TeamNote id, required) — The team note whose status to set (TeamNote id)
- `Status` (TeamNoteStatus, required) — The new kanban status: Open, InProgress, or Done

### Responses

- **200** `SetTeamNoteStatusResponse` — OK
  - `TeamNoteId` (TeamNote id, required) — The team note whose status was set (TeamNote id)
  - `Status` (TeamNoteStatus, required) — The note's kanban status after the change: Open, InProgress, or Done
  - `ModifiedAt` (string (date-time), required) — When the change was recorded (UTC, ISO 8601)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Shift

## POST /api/shift/set-confirmation — Set shift confirmation

Records the assigned person's own answer to their shift (on my way / can't make it). Only the assignee can answer: the key's account must be the person the shift is assigned to — no permission lets anyone answer for someone else.

### Request body (SetShiftConfirmationRequest)

- `ShiftId` (Shift id, required) — The shift to answer; must be assigned to the calling person (Shift id)
- `Confirmation` (ShiftConfirmation, required) — The answer to record: OnMyWay, CantMakeIt, or None to withdraw a previous answer

### Responses

- **200** `SetShiftConfirmationResponse` — OK
  - `ShiftId` (Shift id, required) — The shift that was answered (Shift id)
  - `Confirmation` (ShiftConfirmation, required) — The recorded answer: OnMyWay, CantMakeIt, or None when withdrawn
  - `ConfirmedAt` (string (date-time), required, nullable) — When the answer was recorded (UTC, ISO 8601); null when withdrawn
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Chat

## POST /api/chat/send-message — Send chat message

Sends a text message into an in-app conversation as the calling person. The conversation must be one the account can read: its own direct conversations, or an event room whose audience it belongs to.

### Request body (SendChatMessageRequest)

- `ConversationId` (ChatConversation id, required) — The conversation to post into (ChatConversation id)
- `Content` (string, required) — The message text

### Responses

- **200** `SendChatMessageResponse` — OK
  - `ChatMsgId` (ChatMsg id, required) — The stored message (ChatMsg id)
  - `SentAtUtc` (string (date-time), required) — When the message was stored (UTC)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/chat/send-voice — Send chat voice message

Uploads a recorded voice message (multipart form field 'file') and posts it into an in-app conversation as the calling person. Same conversation rules as sending a text message.

### Responses

- **200** `SendChatMessageResponse` — OK
  - `ChatMsgId` (ChatMsg id, required) — The stored message (ChatMsg id)
  - `SentAtUtc` (string (date-time), required) — When the message was stored (UTC)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Act

## POST /api/act/add-member — Add person to acts

Adds a person to one or more acts as a member (artist, crew). Partial success: an act the caller may not edit is reported in `Failures` while the others are processed. The event is each act's own event.

**Authorization:** requires
- **Booking → Edit** in any team for the event the request refers to — *Create and edit acts, stages, timeslots, timetable assignments*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (AddPersonToActsRequest)

- `ActIds` (Act id, required) — The acts to add the person to as a performing member (Act id)
- `PersonId` (Person id, required) — The person to add as a member (Person id)

### Responses

- **200** `AddPersonToActsResponse` — OK
  - `ActResults` (array of ActMembershipResult, required) — One entry per act the person was added to (or already belonged to)
    - `ActName` (string, required) — Name of the act
    - `WasNewlyAdded` (boolean, required) — True for a new membership, false when the person was already a member
  - `Failures` (array of ActMembershipFailure, required) — Acts the person could not be added to, with a stable reason code
    - `ActName` (string, required) — Name of the act
    - `Reason` (string, required) — Stable reason code, e.g. MissingPermission
  - `WasEffective` (boolean, required) — True if at least one act membership was newly created
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Role

## POST /api/role/create — Create role

Creates a new role with no permissions. Grant permissions afterwards with set-permission-bit.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (CreateRoleRequest)

- `Name` (string, required) — Name of the new role

### Responses

- **200** `CreateRoleResponse` — OK
  - `RoleId` (Role id, required) — Id of the new role (Role id)
  - `Name` (string, required) — Name of the new role
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/role/delete — Delete role

Deletes a role. Memberships that carried it lose it.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (DeleteRoleRequest)

- `RoleId` (Role id, required) — The role to delete (Role id)

### Responses

- **200** `DeleteRoleResponse` — OK
  - `RoleId` (Role id, required) — Id of the deleted role (Role id)
  - `Name` (string, required) — Name of the deleted role
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/role/set-permission — Set role permission

Sets one of the legacy boolean permissions on a role by property name. Prefer set-permission-bit for registry permissions.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SetRolePermissionRequest)

- `RoleId` (Role id, required) — The role to update (Role id)
- `PermissionName` (string, required) — Name of the boolean permission property
- `Value` (boolean, required) — Whether to enable or disable the permission

### Responses

- **200** `SetRolePermissionResponse` — OK
  - `RoleId` (Role id, required) — The role that was updated (Role id)
  - `PermissionName` (string, required) — The permission that was set, as named in the request
  - `IsGranted` (boolean, required) — Whether the role now holds the permission
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/role/set-permission-bit — Set role permission bit

Grants or revokes one registry permission on a role by its dotted name (e.g. "Team.Manage") — the PermissionBits path the Roles page writes

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SetRolePermissionBitRequest)

- `RoleId` (Role id, required) — The role to update (Role id)
- `PermissionName` (string, required) — Dotted permission identifier from the registry, e.g. "Team.Manage"
- `Value` (boolean, required) — Whether to grant or revoke the permission

### Responses

- **200** `SetRolePermissionResponse` — OK
  - `RoleId` (Role id, required) — The role that was updated (Role id)
  - `PermissionName` (string, required) — The permission that was set, as named in the request
  - `IsGranted` (boolean, required) — Whether the role now holds the permission
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Person

## POST /api/person/create — Create person

Creates a new person record. Team memberships and event registration are separate calls.

**Authorization:** requires
- **Person → Administrate** in any team for any event — *Delete people, create people with name & email only*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (CreatePersonRequest)

- `FirstName` (string, required) — First name of the new person
- `LastName` (string, required) — Last name of the new person
- `Email` (string, required) — Email address of the new person

### Responses

- **200** `CreatePersonResponse` — OK
  - `PersonId` (Person id, required) — Id of the new person (Person id)
  - `FirstName` (string, required) — First name of the new person
  - `LastName` (string, required) — Last name of the new person
  - `Email` (string, required) — Email address of the new person
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/person/delete — Delete person (everywhere)

Deletes a person from all teams, roles, shifts, and the database. Irreversible.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (DeletePersonRequest)

- `PersonId` (Person id, required) — The person to delete (Person id)

### Responses

- **200** — OK
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/person/block — Block / unblock person

Blocks a person with a reason, or unblocks them (null reason = unblock). A blocked person cannot sign in or be scheduled.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (BlockPersonRequest)

- `PersonId` (Person id, required) — The person to block or unblock (Person id)
- `Reason` (string, optional, nullable) — Block reason (null or empty to unblock)

### Responses

- **200** `BlockPersonResponse` — OK
  - `PersonId` (Person id, required) — The person that was blocked or unblocked (Person id)
  - `IsBlocked` (boolean, required) — Whether the person is now blocked from signing in
  - `BlockReason` (string, required, nullable) — The block reason shown to administrators; null when unblocked
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/person/send-mail — Send mail

Sends one of the instance's mail templates to a person, rendered for the given event.

**Authorization:** requires
- **Mail → Send** in at least one team the person named by `PersonId` is a member of, for the event named by `EventId` — *Send emails to people via the person menu*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SendMailRequest)

- `PersonId` (Person id, required) — The person to send the mail to (Person id)
- `MailTemplateId` (integer, required) — ID of the mail template to use
- `EventId` (EventData id, required) — Event context for the mail (EventData id)
- `Variables` (object, optional, nullable) — Optional template variable overrides

### Responses

- **200** — OK
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/person/remove-from-event — Remove from event

Removes a person from an event: their memberships, shifts, and applications for that event are dropped; the person record stays.

**Authorization:** requires
- **Person → Administrate** in at least one team the person named by `PersonId` is a member of, for the event named by `EventId` — *Delete people, create people with name & email only*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (RemovePersonFromEventRequest)

- `PersonId` (Person id, required) — The person to remove (Person id)
- `EventId` (EventData id, required) — The event to remove the person from (EventData id)

### Responses

- **200** — OK
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/person/set-data — Set person data

Patches a person's basic profile fields (names, nickname handling, pronouns, city, contact data); null fields stay unchanged

**Authorization:** requires
- **Person → Edit** in any team for any event — *Create and edit people in accessible teams*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SetPersonDataRequest)

- `PersonId` (Person id, required) — The person to update (Person id)
- `FirstName` (string, optional, nullable) — New first name; null = unchanged
- `LastName` (string, optional, nullable) — New last name; null = unchanged
- `NickName` (string, optional, nullable) — New nickname; null = unchanged
- `IsNicknameOnly` (boolean, optional) — Whether the person wants to be addressed by nickname only; null = unchanged
- `Pronouns` (string, optional, nullable) — New pronouns; null = unchanged
- `City` (string, optional, nullable) — New city; null = unchanged
- `Email` (string, optional, nullable) — New email address; null = unchanged. Must be a valid address — empty is rejected, not a way to clear it
- `Phone` (string, optional, nullable) — New phone number; null = unchanged

### Responses

- **200** `SetPersonDataResponse` — OK
  - `PersonId` (Person id, required) — The person that was updated (Person id)
  - `FirstName` (string, required) — First name
  - `LastName` (string, required) — Last name
  - `NickName` (string, required) — Nickname; empty when none
  - `IsNicknameOnly` (boolean, required) — Whether the person wants to be addressed by nickname only
  - `Pronouns` (string, required) — Pronouns; empty when none
  - `City` (string, required) — City; empty when none
  - `Email` (string, required) — Email address
  - `Phone` (string, required) — Phone number; empty when none
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Application

## POST /api/application/submit — Submit team application

Creates an application from form values for an application process and an applicant. An account may always apply as itself; submitting on behalf of someone else needs the permission below for the process's event.

**Authorization:** requires
- **Application → Edit** in any team for the event the request refers to — *Configure the application process, accept and reject submissions; manage deposit exceptions*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (SubmitTeamApplicationRequest)

- `PersonId` (Person id, required) — The applicant submitting the form (Person id)
- `ApplicationProcessId` (ApplicationProcess id, required) — The process being applied to (ApplicationProcess id)
- `Values` (JsonElement, required) — Submitted form values keyed by field name (BSON-extended JSON object)

### Responses

- **200** `SubmitTeamApplicationResult` — OK
  - `ApplicationId` (Application id, required) — The new application (Application id)
  - `PersonId` (Person id, required) — The applicant (Person id)
  - `TeamId` (Team id, required) — The team applied to (Team id)
  - `EventId` (EventData id, required) — The event of the application process (EventData id)
  - `State` (ApplicationState, required) — Initial state of the application
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# API key

## POST /api/api-key/create — Create API key

Creates a new API key for a person and returns the raw key exactly once — it is stored hashed and cannot be shown again.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (CreateApiKeyRequest)

- `PersonId` (Person id, required) — The person to create the API key for (Person id)
- `Label` (string, required) — A label to identify this API key
- `ExpiresAt` (string (date-time), optional, nullable) — Optional ISO 8601 timestamp after which the key stops working. Null = the key never expires by time.

### Responses

- **200** `CreateApiKeyResponse` — OK
  - `ApiKeyId` (ApiKey id, required) — Id of the new API key record (ApiKey id)
  - `KeyPrefix` (string, required) — The first characters of the key, for identifying it in lists
  - `PersonId` (Person id, required) — The person the key authenticates as (Person id)
  - `Label` (string, required) — The label given to the key
  - `ExpiresAt` (string (date-time), required, nullable) — ISO 8601 timestamp after which the key stops working; null = never expires by time
  - `RawKey` (string, required) — The bearer token itself. Store it now — it cannot be retrieved again
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/api-key/revoke — Revoke API key

Revokes an API key immediately. Requests with it answer 401 from then on.

**Authorization:** requires
- **Administrator** — the key's account must hold the admin role

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (RevokeApiKeyRequest)

- `ApiKeyId` (ApiKey id, required) — The API key to revoke (ApiKey id)

### Responses

- **200** `RevokeApiKeyResponse` — OK
  - `ApiKeyId` (ApiKey id, required) — Id of the revoked API key record (ApiKey id)
  - `PersonId` (Person id, required) — The person the key authenticated as (Person id)
  - `Label` (string, required) — The label given to the key
  - `RevokedAt` (string (date-time), required, nullable) — When the key was revoked (UTC, ISO 8601)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Wiki

## GET /api/wiki/schema — Read the wiki authoring contract

Returns every TipTap node and mark the wiki renderer understands, their attributes, and the closed value sets (theme colors, callout kinds, image layout options) — the full formatting vocabulary an API client can author with.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Responses

- **200** `WikiSchemaResponse` — OK
  - `DocumentShape` (string, required) — The shape of the document root every page's content must have
  - `Nodes` (array of WikiSchemaEntry, required) — Every renderable node type
    - `Type` (string, required) — The value of the node's type field (or the mark's name)
    - `Description` (string, required) — What the node or mark renders as
    - `Attributes` (object, required) — The attributes it accepts, described in place
    - `Example` (string, required) — A minimal JSON example
  - `Marks` (array of WikiSchemaEntry, required) — Every renderable inline mark
    - `Type` (string, required) — The value of the node's type field (or the mark's name)
    - `Description` (string, required) — What the node or mark renders as
    - `Attributes` (object, required) — The attributes it accepts, described in place
    - `Example` (string, required) — A minimal JSON example
  - `ThemeColorTokens` (array of string, required) — The allowed themeColor tokens; free hex colors are dropped by the renderer
  - `CalloutKinds` (array of string, required) — The allowed callout kinds
  - `ImageAlignments` (array of string, required) — The allowed image alignments
  - `ImageRadii` (array of string, required) — The allowed image corner treatments
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/pages — List wiki pages

Returns every active wiki page the key's account may view — metadata only by default, full TipTap content and plain text with ?includeContent=true (the entire wiki in one response), archived pages too with ?includeArchived=true.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `includeContent` (query, boolean, optional) — True to include each page's TipTap content and plain text. Default: false
- `includeArchived` (query, boolean, optional) — True to also list archived (soft-deleted) pages. Default: false

### Responses

- **200** `WikiPageListResponse` — OK
  - `Pages` (array of WikiApiPage, required) — Every active wiki page the key's account may view, ordered by slug
    - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
    - `Title` (string, required) — The page title
    - `Tags` (array of string, required) — Freeform tags
    - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
    - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
    - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
    - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
    - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
    - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
    - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
    - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
    - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
    - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
    - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
    - `IsLocked` (boolean, required) — Whether the page carries an edit lock
    - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
    - `Content` (JsonElement, required)
    - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
  - `GeneratedAt` (string (date-time), required) — UTC timestamp at which this response was generated (ISO 8601)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/wiki/pages — Create a wiki page

Creates a wiki page from a TipTap JSON document. Revisions, [[wiki-link]] tracking, and RAG indexing behave exactly as for an in-app creation.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (CreateWikiPageRequest)

- `Title` (string, required) — The page title. Must not be empty
- `Content` (JsonElement, required) — The TipTap JSON document — the same format GET returns as Content
- `Slug` (string, optional, nullable) — Preferred slug. Null derives the slug from the title
- `Tags` (array of string, optional, nullable) — Freeform tags. Null creates the page without tags
- `CategoryIds` (ItemCategory id, optional) — Wiki category ids (24-char hex) to file the page under. Null leaves it uncategorized (ItemCategory id)
- `OwnerTeamId` (Team id, optional) — The owning team's id (24-char hex). Null creates an unowned page (Team id)
- `ViewAccessScopes` (array of WikiApiAccessScope, optional, nullable) — View access grants. Null leaves the page visible to every wiki viewer
  - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
  - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
  - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
  - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/search — Search wiki pages

Searches title, tags, and body with the app's own case- and diacritic-insensitive semantics (all terms must match) and returns the matching viewable pages with a snippet around the first body hit.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `query` (query, string, required) — The search terms. Whitespace-separated; every term must match
- `limit` (query, integer, optional) — Maximum number of hits. Null returns at most 50
- `includeContent` (query, boolean, optional) — True to include each hit's full TipTap content and plain text. Default: false

### Responses

- **200** `WikiSearchResponse` — OK
  - `Query` (string, required) — The search term the results were produced for
  - `Hits` (array of WikiSearchHit, required) — The matching pages, best matches first
    - `Page` (WikiApiPage, required) — The matching page — metadata only unless content was requested
    - `Snippet` (string, required) — Plain-text excerpt around the first body match; empty when only the title or a tag matched
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/pages/{slug} — Read one wiki page

Returns one wiki page by slug — metadata, the TipTap JSON content, and the extracted plain text. Archived pages resolve with ?includeArchived=true.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The page's slug
- `includeArchived` (query, boolean, optional) — True to also resolve archived (soft-deleted) pages. Default: false

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## PUT /api/wiki/pages/{slug} — Update a wiki page

Updates a wiki page by slug. Null request fields are left unchanged; every update snapshots a revision, honors page edit locks, and re-runs link tracking and RAG indexing. Also carries owner-team reassignment and the RAG-exclusion flag.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The page's slug

### Request body (UpdateWikiPageRequest)

- `Title` (string, optional, nullable) — New title. Null keeps the current title
- `Content` (object, optional) — New TipTap JSON document. Null keeps the current content
- `EditSummary` (string, optional, nullable) — Edit summary recorded on the revision. Null records 'Edited via API'
- `Tags` (array of string, optional, nullable) — Replacement tag set. Null keeps the current tags
- `CategoryIds` (ItemCategory id, optional) — Replacement wiki category ids (24-char hex). Null keeps the current categories (ItemCategory id)
- `ViewAccessScopes` (array of WikiApiAccessScope, optional, nullable) — Replacement view access grants (empty list = visible to every wiki viewer). Null keeps the current scopes
  - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
  - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
  - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
  - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
- `OwnerTeam` (WikiApiOwnerTeamAssignment, optional)
- `ExcludedFromRag` (boolean, optional) — True withholds the page from AI retrieval indexing, false re-includes it. Null keeps the current setting

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## DELETE /api/wiki/pages/{slug} — Archive a wiki page

Archives (soft-deletes) a wiki page: it disappears from the wiki and this API's reads and its RAG chunks are removed, but the document and its revisions remain recoverable in the database.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The page's slug

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/categories — List wiki categories

Returns the wiki's category tree with the viewable page count per category — the ids a page's categoryIds refer to.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Responses

- **200** `WikiCategoryListResponse` — OK
  - `Categories` (array of WikiApiCategory, required) — The wiki categories, ordered by display order then name
    - `Id` (ItemCategory id, required) — The category's id (24-char hex) — use it in a page's categoryIds (ItemCategory id)
    - `Name` (string, required) — The category name
    - `ParentCategoryId` (ItemCategory id, required) — Parent category id, or null for a top-level category (ItemCategory id)
    - `Color` (string, required) — Color for the category chip; empty when uncolored
    - `Note` (string, required) — Free-text note describing the category
    - `DisplayOrder` (integer, required) — Sort position among siblings
    - `PageCount` (integer, required) — How many viewable active pages are filed under this category
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/wiki/categories — Create a wiki category

Creates a category in the wiki context, immediately usable in a page's categoryIds. Requires the Wiki → Manage permission.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Request body (CreateWikiCategoryRequest)

- `Name` (string, required) — The category name. Must not be empty
- `ParentCategoryId` (ItemCategory id, optional) — Parent category id (24-char hex). Null creates a top-level category (ItemCategory id)
- `Color` (string, optional, nullable) — Color for the category chip. Null leaves it uncolored
- `Note` (string, optional, nullable) — Free-text note describing the category. Null leaves it empty
- `DisplayOrder` (integer, optional, nullable) — Sort position among siblings. Null sorts it last

### Responses

- **200** `WikiApiCategory` — OK
  - `Id` (ItemCategory id, required) — The category's id (24-char hex) — use it in a page's categoryIds (ItemCategory id)
  - `Name` (string, required) — The category name
  - `ParentCategoryId` (ItemCategory id, required) — Parent category id, or null for a top-level category (ItemCategory id)
  - `Color` (string, required) — Color for the category chip; empty when uncolored
  - `Note` (string, required) — Free-text note describing the category
  - `DisplayOrder` (integer, required) — Sort position among siblings
  - `PageCount` (integer, required) — How many viewable active pages are filed under this category
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/files — List uploaded wiki images

Returns every image in wiki file storage with its served URL, so an existing image can be embedded again instead of re-uploaded.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Responses

- **200** `WikiFileListResponse` — OK
  - `Files` (array of WikiApiFile, required) — The uploaded files, newest first
    - `WikiFileId` (WikiFile id, required) — The file record's id (24-char hex) (WikiFile id)
    - `Url` (string, required) — The served URL — use it as an image node's src
    - `FileName` (string, required) — The original file name
    - `MimeType` (string, required) — The file's MIME type
    - `FileSizeBytes` (integer, required) — The stored size in bytes
    - `UploadedByPersonId` (Person id, required) — Id of the person who uploaded the file (Person id)
    - `UploadedAt` (string (date-time), required) — UTC upload instant (ISO 8601)
    - `ReferencingPageIds` (WikiPage id, required) — Ids of the pages known to embed this file (WikiPage id)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/wiki/files — Upload a wiki image

Uploads an image (multipart form field 'file', max 5 MB, image/* only) into wiki file storage and returns the stable URL to use as an image node's src in page content.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Responses

- **200** `WikiFileUploadResponse` — OK
  - `Url` (string, required) — The served URL — use this as the src attribute of an image node
  - `WikiFileId` (WikiFile id, required) — Id of the created file record (WikiFile id)
  - `FileName` (string, required) — The original file name
  - `MimeType` (string, required) — The file's MIME type
  - `FileSizeBytes` (integer, required) — The stored size in bytes
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/access-options — Read the ids used in ownership and access scopes

Returns teams, roles, and events by name — the ids needed to set a page's ownerTeamId and to compose its view and edit access scopes.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Responses

- **200** `WikiAccessOptionsResponse` — OK
  - `Teams` (array of WikiApiNamedOption, required) — Every team — use for a page's ownerTeamId and a scope's teamId
    - `Id` (string, required) — The entity's id (24-char hex)
    - `Name` (string, required) — The entity's display name
    - `ParentId` (string, required) — The parent entity's id when the entity forms a tree (teams), else null
  - `Roles` (array of WikiApiNamedOption, required) — Every role — use for a scope's roleId
    - `Id` (string, required) — The entity's id (24-char hex)
    - `Name` (string, required) — The entity's display name
    - `ParentId` (string, required) — The parent entity's id when the entity forms a tree (teams), else null
  - `Events` (array of WikiApiNamedOption, required) — Every event — use for a scope's eventId
    - `Id` (string, required) — The entity's id (24-char hex)
    - `Name` (string, required) — The entity's display name
    - `ParentId` (string, required) — The parent entity's id when the entity forms a tree (teams), else null
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/wiki/pages/{slug}/revisions — Read a wiki page's revision history

Returns the revision snapshots of one wiki page, newest first — metadata only by default, full TipTap content snapshots with ?includeContent=true.

**Authorization:** requires
- **Api → Read Wiki** in any team for any event — *Read wiki pages — content, metadata, and revision history — via the external wiki API. The account additionally needs Wiki → View; page-level view locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The page's slug
- `includeContent` (query, boolean, optional) — True to include each revision's TipTap content snapshot. Default: false

### Responses

- **200** `WikiRevisionListResponse` — OK
  - `Slug` (string, required) — The page's slug
  - `Revisions` (array of WikiApiRevision, required) — The revision snapshots, newest first
    - `RevisionNumber` (integer, required) — The revision's number
    - `Title` (string, required) — The page title as of this revision
    - `EditedByPersonId` (Person id, required) — Id of the person whose edit produced the next revision (Person id)
    - `EditedAt` (string (date-time), required) — UTC instant the snapshot was taken (ISO 8601)
    - `EditSummary` (string, required) — The edit summary supplied with the overwriting edit
    - `Content` (JsonElement, required)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/wiki/pages/{slug}/revert — Revert a wiki page to an earlier revision

Restores the title and content of an earlier revision. The revert is itself a revisioned edit, so it can be undone. Requires the Wiki → Manage permission.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The page's slug

### Request body (RevertWikiPageRequest)

- `RevisionNumber` (integer, required) — The revision number to restore — one of the numbers returned by the revisions endpoint

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## POST /api/wiki/pages/{slug}/restore — Restore an archived wiki page

Un-archives a page: it reappears in the wiki and in this API's reads and is re-indexed for AI retrieval. Requires the Wiki → Manage permission.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The archived page's slug

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## PUT /api/wiki/pages/{slug}/access — Replace a wiki page's access rules

Replaces the page's edit lock, view scopes, edit scopes, and explicit person edit grants without touching content or revisions. Requires the Wiki → Manage permission.

**Authorization:** requires
- **Api → Write Wiki** in any team for any event — *Create, edit, and archive wiki pages via the external wiki API. The account additionally needs the corresponding Wiki permission (Create / Edit / Delete); page-level edit locks still apply*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `slug` (path, string, required) — The page's slug

### Request body (SetWikiPageAccessRequest)

- `IsLocked` (boolean, optional) — Whether the edit lock is enabled. Default: false
- `ViewAccessScopes` (array of WikiApiAccessScope, optional, nullable) — View access grants. Null or empty = visible to every wiki viewer
  - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
  - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
  - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
  - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
- `EditAccessScopes` (array of WikiApiAccessScope, optional, nullable) — Edit access grants applied while the page is locked. Null = no scope grants
  - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
  - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
  - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
  - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
- `EditAllowedPersonIds` (Person id, optional) — Ids (24-char hex) of people explicitly allowed to edit the locked page. Null = none (Person id)

### Responses

- **200** `WikiApiPage` — OK
  - `Slug` (string, required) — URL-friendly unique identifier — the API's page key, also used for [[wiki-linking]]
  - `Title` (string, required) — The page title
  - `Tags` (array of string, required) — Freeform tags
  - `CategoryIds` (ItemCategory id, required) — Ids of the wiki categories the page is filed under (ItemCategory id)
  - `OwnerTeamId` (Team id, required) — The owning team's id, or null when the page is unowned (Team id)
  - `RevisionNumber` (integer, required) — The current revision number (1 = never edited since creation)
  - `CreatedAt` (string (date-time), required) — UTC creation instant (ISO 8601)
  - `LastEditedAt` (string (date-time), required) — UTC instant of the latest edit (ISO 8601)
  - `CreatedByPersonId` (Person id, required) — Id of the person who created the page (Person id)
  - `LastEditedByPersonId` (Person id, required) — Id of the person who made the latest edit (Person id)
  - `IsArchived` (boolean, required) — Whether the page is archived (soft-deleted) and hidden from the wiki
  - `ExcludedFromRag` (boolean, required) — Whether the page is withheld from AI retrieval indexing
  - `ForwardLinkSlugs` (array of string, required) — Slugs this page links to via [[wiki-link]]s
  - `BacklinkSlugs` (array of string, required) — Slugs of the pages that link to this page
  - `IsLocked` (boolean, required) — Whether the page carries an edit lock
  - `ViewAccessScopes` (array of WikiApiAccessScope, required) — View access grants. Empty = visible to every wiki viewer; non-empty = the viewer must match at least one scope
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAccessScopes` (array of WikiApiAccessScope, required) — Edit access grants. Only meaningful while the page is locked
    - `RoleId` (Role id, optional) — Required role id (24-char hex), or null for any role (Role id)
    - `TeamId` (Team id, optional) — Required team id (24-char hex), or null for any team (Team id)
    - `IncludesChildTeams` (boolean, optional) — Whether TeamId also matches its child teams. Default: false
    - `EventId` (EventData id, optional) — Required event id (24-char hex), or null for any event (EventData id)
  - `EditAllowedPersonIds` (Person id, required) — Ids of the people explicitly allowed to edit the locked page (Person id)
  - `Content` (JsonElement, required)
  - `PlainTextContent` (string, required, nullable) — Plain text extracted from the content, or null when content was not requested
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Timetable

## GET /api/timetable/public — Public timetable export

Returns the full public timetable of an event — the publicly visible stages, their performance slots, and the public profiles of all referenced announced acts. Slots of unannounced acts are masked as TBA. Read-only; exposes exactly what the public timetable page shows and no internal data.

**Authorization:** requires
- **Api → Read Public Timetable** in any team for the event named by `eventId` — *Read the public timetable, lineup, and act photos of an event via the external API*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `eventId` (query, string, required) — The event whose public timetable to export (EventData id)
- `language` (query, string, optional) — Language for genre display names: "German" (default) or "English". Case-insensitive

### Responses

- **200** `PublicTimetableResponse` — OK
  - `Event` (PublicTimetableEventInfo, required) — The event this timetable belongs to
    - `Id` (EventData id, required) — The event's unique ID (24-character hexadecimal) (EventData id)
    - `Name` (string, required) — Display name of the event
    - `TimeZoneId` (string, required) — IANA time zone ID of the event (e.g. "Europe/Vienna"). Empty when not configured — slot times are then UTC
  - `Stages` (array of PublicTimetableStage, required) — The publicly visible stages in display order, each with its public performance slots
    - `Id` (Stage id, required) — The stage's unique ID (24-character hexadecimal) (Stage id)
    - `Name` (string, required) — Display name of the stage
    - `ColorHex` (string, required) — Hex color code used for the stage's visual identity (e.g. "#722ed1"). May be empty
    - `DisplayOrder` (integer, required) — Sort order of the stage (lower = first). Stages arrive pre-sorted by this value
    - `Slots` (array of PublicTimetableSlot, required) — The stage's publicly visible performance slots in chronological order
  - `Acts` (array of PublicTimetableAct, required) — The public profiles of all announced acts referenced by at least one slot, ordered by name — an act playing several slots appears exactly once
    - `Id` (Act id, required) — The act's unique ID (24-character hexadecimal). Referenced by slots via ActId (Act id)
    - `Name` (string, required) — Public name of the act
    - `PromoText` (string, required) — Public-facing promotional text for websites and lineup announcements. May be empty
    - `Genres` (array of string, required) — Genre display names in the requested language (e.g. "Techno", "House"). Empty when no genre is set
    - `CityOrHome` (string, required) — City or country of origin. May be empty
    - `Label` (string, required) — Label or collective affiliation (e.g. "Stil vor Talent"). May be empty
    - `ExternalLinks` (array of PublicTimetableExternalLink, required) — Public web links (social media, music profiles) with their detected platform type
    - `IsAnnounced` (boolean, required) — Whether the act is publicly announced. Public keys only ever receive announced acts (always true); internal keys also receive unannounced acts with this set to false — treat those as EMBARGOED and never publish them
  - `GeneratedAt` (string (date-time), required) — UTC timestamp at which this response was generated (ISO 8601)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

# Lineup

## GET /api/lineup/acts — Public lineup export

Returns the public profiles of all publicly announced acts of an event — name, promo text, genres, origin, label, social links, and photo URLs. Read-only; unannounced acts are never included.

**Authorization:** requires
- **Api → Read Public Timetable** in any team for the event named by `eventId` — *Read the public timetable, lineup, and act photos of an event via the external API*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `eventId` (query, string, required) — The event whose lineup to export (EventData id)
- `language` (query, string, optional) — Language for genre and act-type display names: "German" (default) or "English". Case-insensitive

### Responses

- **200** `PublicLineupResponse` — OK
  - `Event` (PublicTimetableEventInfo, required) — The event this lineup belongs to
    - `Id` (EventData id, required) — The event's unique ID (24-character hexadecimal) (EventData id)
    - `Name` (string, required) — Display name of the event
    - `TimeZoneId` (string, required) — IANA time zone ID of the event (e.g. "Europe/Vienna"). Empty when not configured — slot times are then UTC
  - `Acts` (array of PublicLineupAct, required) — The public profiles of all publicly announced acts of the event, ordered by name
    - `Id` (Act id, required) — The act's unique ID (24-character hexadecimal). Matches the ActId used by the timetable export (Act id)
    - `Name` (string, required) — Public name of the act
    - `PromoText` (string, required) — Public-facing promotional text for websites and lineup announcements. May be empty
    - `ActType` (string, required) — Act type display name in the requested language (e.g. "DJ", "Live Band", "Workshop"). Empty when no act type is set
    - `Genres` (array of string, required) — Genre display names in the requested language (e.g. "Techno", "House"). Empty when no genre is set
    - `CityOrHome` (string, required) — City or country of origin. May be empty
    - `Label` (string, required) — Label or collective affiliation (e.g. "Stil vor Talent"). May be empty
    - `AnnouncementWave` (string, required) — Which lineup release wave announced this act (e.g. "No. 1 (Dezember)"). May be empty
    - `ExternalLinks` (array of PublicTimetableExternalLink, required) — Public web links (social media, music profiles) with their detected platform type
    - `Photos` (array of PublicLineupPhoto, required) — The act's public photos with ready-to-use download URLs. Empty when none are uploaded
    - `IsAnnounced` (boolean, required) — Whether the act is publicly announced. Public keys only ever receive announced acts (always true); internal keys also receive unannounced acts with this set to false — treat those as EMBARGOED and never publish them
  - `GeneratedAt` (string (date-time), required) — UTC timestamp at which this response was generated (ISO 8601)
- **401** — Missing or invalid API key
- **403** `ApiErrorResponse` — The key's account lacks a required permission (see *Authorization* above). `RequiredPermission.Name` is the dotted permission; the team and event echoed are the ones the request named.
- **422** `ApiErrorResponse` — The request cannot be applied: unknown or malformed id, closed or full team, invalid value. `Code` identifies the case, `Description` explains it.

## GET /api/lineup/act-photo — Act photo download

Serves one image attachment of a publicly announced act, optionally resized (tiny/small/medium/large, WebP). URLs for this endpoint come from the lineup export response; the same Bearer key is required.

**Authorization:** requires
- **Api → Read Public Timetable** in any team for the event the request refers to — *Read the public timetable, lineup, and act photos of an event via the external API*

Permissions come with memberships (a role in a team for an event) and a permission held in a team also counts in its descendant teams — see *Authorization* at the top of this document.

### Parameters

- `attachmentId` (query, string, required) — The photo's attachment, taken from the lineup export's photo URLs (AttachmentInfo id)
- `variant` (query, string, optional) — Size variant: "original" (default), "tiny", "small", "medium", or "large". Unknown values fall back to "original"

### Responses

- **200** — The image file, a 403 denial when the account holds no read permission at all, or the uniform 422 error otherwise.
- **401** — Missing or invalid API key
