{
  "openapi": "3.1.0",
  "info": {
    "title": "Kanbun REST API",
    "version": "1.0.0",
    "description": "Read and change boards, columns, cards, comments, checklists, attachments, tags and automation rules, and search cards, with a personal access token. See docs/API.md for authentication, pagination, errors, rate limits and webhooks.",
    "license": { "name": "AGPL-3.0-only", "identifier": "AGPL-3.0-only" }
  },
  "servers": [{ "url": "/api/v1" }],
  "security": [{ "bearerAuth": [] }],
  "tags": [
    { "name": "Account" },
    { "name": "Boards" },
    { "name": "Columns" },
    { "name": "Cards" },
    { "name": "Comments" },
    { "name": "Checklists" },
    { "name": "Attachments" },
    { "name": "Tags" },
    { "name": "Search" },
    { "name": "Automations" }
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": ["Account"],
        "operationId": "getMe",
        "summary": "The user the token belongs to",
        "responses": {
          "200": { "description": "The user and the token in use.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Me" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/boards": {
      "get": {
        "tags": ["Boards"],
        "operationId": "listBoards",
        "summary": "Boards the user can open",
        "description": "Admins see every board, other users the boards they are a member of. Archived boards are included (see `archived`).",
        "parameters": [{ "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Cursor" }],
        "responses": {
          "200": {
            "description": "A page of boards.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data", "next"],
                  "properties": {
                    "data": { "type": "array", "items": { "$ref": "#/components/schemas/Board" } },
                    "next": { "$ref": "#/components/schemas/NextCursor" }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/boards/{boardId}": {
      "parameters": [{ "$ref": "#/components/parameters/BoardId" }],
      "get": {
        "tags": ["Boards"],
        "operationId": "getBoard",
        "summary": "A board with its columns and tags",
        "responses": {
          "200": { "description": "The board.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BoardDetail" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/boards/{boardId}/columns": {
      "parameters": [{ "$ref": "#/components/parameters/BoardId" }],
      "get": {
        "tags": ["Columns"],
        "operationId": "listColumns",
        "summary": "Columns of a board, in order",
        "responses": {
          "200": {
            "description": "All columns.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Column" } } }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Columns"],
        "operationId": "createColumn",
        "summary": "Add a column at the end of the board",
        "description": "Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ColumnCreate" } } }
        },
        "responses": {
          "201": { "description": "The new column.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Column" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/columns/{columnId}": {
      "parameters": [{ "$ref": "#/components/parameters/ColumnId" }],
      "patch": {
        "tags": ["Columns"],
        "operationId": "updateColumn",
        "summary": "Rename a column, set its WIP limit or move it",
        "description": "Needs the write scope. Changing `position` needs a board owner or an admin.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ColumnUpdate" } } }
        },
        "responses": {
          "200": { "description": "The updated column.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Column" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "delete": {
        "tags": ["Columns"],
        "operationId": "deleteColumn",
        "summary": "Move a column and its cards to the trash",
        "description": "Needs the write scope and a board owner or an admin. Restorable from the trash for 30 days. Webhooks get one card.deleted per card, with reason column.deleted.",
        "responses": {
          "200": { "description": "Deleted.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Trashed" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/boards/{boardId}/cards": {
      "parameters": [{ "$ref": "#/components/parameters/BoardId" }],
      "get": {
        "tags": ["Cards"],
        "operationId": "listCards",
        "summary": "Cards of a board",
        "description": "Ordered by column, then by position in the column. Archived cards are left out unless `archived` asks for them.",
        "parameters": [
          {
            "name": "archived",
            "in": "query",
            "description": "`false` (default): cards on the board. `true`: only archived cards. `all`: both.",
            "schema": { "type": "string", "enum": ["false", "true", "all"], "default": "false" }
          },
          { "name": "column", "in": "query", "description": "Only cards in this column (id).", "schema": { "type": "string" } },
          { "name": "assignee", "in": "query", "description": "Only cards assigned to this user (id or username).", "schema": { "type": "string" } },
          { "name": "tag", "in": "query", "description": "Only cards with this tag (id or exact name).", "schema": { "type": "string" } },
          { "name": "updatedSince", "in": "query", "description": "Only cards changed at or after this time (ISO 8601).", "schema": { "type": "string", "format": "date-time" } },
          { "$ref": "#/components/parameters/Limit" },
          { "$ref": "#/components/parameters/Cursor" }
        ],
        "responses": {
          "200": {
            "description": "A page of cards.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data", "next"],
                  "properties": {
                    "data": { "type": "array", "items": { "$ref": "#/components/schemas/Card" } },
                    "next": { "$ref": "#/components/schemas/NextCursor" }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Cards"],
        "operationId": "createCard",
        "summary": "Create a card",
        "description": "Needs the write scope. Board watchers and assignees are notified, open boards update live.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardCreate" } } }
        },
        "responses": {
          "201": { "description": "The new card.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Card" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/cards/{cardId}": {
      "parameters": [{ "$ref": "#/components/parameters/CardId" }],
      "get": {
        "tags": ["Cards"],
        "operationId": "getCard",
        "summary": "A card",
        "description": "Archived cards are returned too, with `archived: true`.",
        "responses": {
          "200": { "description": "The card.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Card" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "patch": {
        "tags": ["Cards"],
        "operationId": "updateCard",
        "summary": "Change a card or move it",
        "description": "Needs the write scope. Send only the fields to change. `columnId` and `position` move the card (position 0 is the top of the column). `assigneeIds` and `tagIds` replace the whole set. `archived: true` archives the card (it leaves the board), `archived: false` restores it to its column; an archived card can only be moved together with `archived: false`.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardUpdate" } } }
        },
        "responses": {
          "200": { "description": "The updated card.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Card" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": {
            "description": "The card is archived and the request moves it without restoring it (`card_archived`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "delete": {
        "tags": ["Cards"],
        "operationId": "deleteCard",
        "summary": "Move a card to the trash",
        "description": "Needs the write scope. Restorable from the trash for 30 days.",
        "responses": {
          "200": { "description": "Deleted.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Trashed" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/cards/{cardId}/comments": {
      "parameters": [{ "$ref": "#/components/parameters/CardId" }],
      "get": {
        "tags": ["Comments"],
        "operationId": "listComments",
        "summary": "Comments on a card, oldest first",
        "parameters": [{ "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Cursor" }],
        "responses": {
          "200": {
            "description": "A page of comments.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data", "next"],
                  "properties": {
                    "data": { "type": "array", "items": { "$ref": "#/components/schemas/Comment" } },
                    "next": { "$ref": "#/components/schemas/NextCursor" }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Comments"],
        "operationId": "createComment",
        "summary": "Comment on a card",
        "description": "Needs the write scope. `@username` mentions and card watchers are notified. Send an `Idempotency-Key` header to retry safely: a repeated request with the same key on the same card returns the comment the first one created (status 200) and notifies nobody again.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A key you choose per comment, for example a UUID: 1 to 100 letters, digits or `_ . : -`. Keys are unique per card.",
            "schema": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "^[A-Za-z0-9_.:-]{1,100}$" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["body"],
                "properties": { "body": { "type": "string", "minLength": 1, "maxLength": 5000, "description": "Markdown." } }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A repeated request with the same `Idempotency-Key`: the comment the first request created.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Comment" } } }
          },
          "201": { "description": "The new comment.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Comment" } } } },
          "400": {
            "description": "The body is not a JSON object, or the `Idempotency-Key` header is malformed (`invalid_idempotency_key`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": {
            "description": "Another user already used this `Idempotency-Key` on this card (`idempotency_key_conflict`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/boards/{boardId}/tags": {
      "parameters": [{ "$ref": "#/components/parameters/BoardId" }],
      "get": {
        "tags": ["Tags"],
        "operationId": "listTags",
        "summary": "Tags of a board",
        "responses": {
          "200": {
            "description": "All tags.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } } }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Tags"],
        "operationId": "createTag",
        "summary": "Create a tag on a board",
        "description": "Needs the write scope and a board owner or an admin, like adding a tag in board settings. Tag names are unique per board, ignoring case: a name that is already there answers 409 `tag_exists` with the existing tag's id in `details.tagId`, so a script can reuse it. Put tags on cards with `PATCH /cards/{cardId}` (`tagIds`).",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TagCreate" } } }
        },
        "responses": {
          "201": {
            "description": "The new tag.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Tag" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": {
            "description": "A tag with this name, ignoring case, is already on the board (`tag_exists`); `details.tagId` is its id.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/cards/{cardId}/checklist": {
      "parameters": [{ "$ref": "#/components/parameters/CardId" }],
      "get": {
        "tags": ["Checklists"],
        "operationId": "listChecklist",
        "summary": "Checklist items of a card, in order",
        "responses": {
          "200": {
            "description": "All items, in checklist order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ChecklistItem" } } }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Checklists"],
        "operationId": "createChecklistItem",
        "summary": "Add a checklist item",
        "description": "Needs the write scope. Anyone who can open the card can add items. An assignee is notified (unless they assign themselves) and must be an active member of the board. Sends `card.updated` with `checklist` in `changes`.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChecklistItemCreate" } } }
        },
        "responses": {
          "201": {
            "description": "The new item.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChecklistItem" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/checklist/{itemId}": {
      "parameters": [{ "$ref": "#/components/parameters/ItemId" }],
      "patch": {
        "tags": ["Checklists"],
        "operationId": "updateChecklistItem",
        "summary": "Tick, untick, rename, assign, set the due date or move an item",
        "description": "Needs the write scope. Send only the fields to change. Ticking an item (`done: true`) records it in the card history, like the checkbox. `position` is the 0-based place in the checklist; the others move to make room. A change sends `card.updated` with `checklist` in `changes`; a request that changes nothing sends nothing.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChecklistItemUpdate" } } }
        },
        "responses": {
          "200": {
            "description": "The item after the change.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChecklistItem" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "delete": {
        "tags": ["Checklists"],
        "operationId": "deleteChecklistItem",
        "summary": "Delete a checklist item",
        "description": "Needs the write scope. Not kept in the trash.",
        "responses": {
          "204": { "description": "Deleted. No body." },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/cards/{cardId}/attachments": {
      "parameters": [{ "$ref": "#/components/parameters/CardId" }],
      "get": {
        "tags": ["Attachments"],
        "operationId": "listAttachments",
        "summary": "Files on a card, oldest first",
        "responses": {
          "200": {
            "description": "All attachments of the card.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Attachment" } } }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Attachments"],
        "operationId": "uploadAttachment",
        "summary": "Upload a file to a card",
        "description": "Needs the write scope. Send `multipart/form-data` with the file in a field named `file`. The limit is `ATTACHMENT_MAX_MB` (default 10 MB), not the 1 MB JSON limit. The file goes to the instance's attachment storage (next to the database, or S3), large PNG, JPEG and WebP images get the same WebP thumbnail as uploads from the app, and the type is taken from the bytes for images (a file that only claims to be an image is stored as `application/octet-stream`). Records \"added <file>\" in the card history and sends `card.updated` with `attachments` in `changes`.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["file"],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file; its name is kept (cleaned up) as `fileName`."
                  }
                }
              },
              "encoding": { "file": { "contentType": "*/*" } }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The stored attachment.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Attachment" } } }
          },
          "400": {
            "description": "No `file` field, or the body is not valid multipart (`bad_request`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "413": {
            "description": "The file is over the size limit (`payload_too_large`); `details.maxBytes` is the limit.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "415": {
            "description": "The body is not `multipart/form-data` (`unsupported_media_type`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "422": {
            "description": "The file is empty (`validation_failed`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "503": {
            "description": "The attachment storage refused or could not be reached (`storage_unavailable`). Nothing was saved; try again.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          }
        }
      }
    },
    "/attachments/{attachmentId}": {
      "parameters": [{ "$ref": "#/components/parameters/AttachmentId" }],
      "get": {
        "tags": ["Attachments"],
        "operationId": "getAttachment",
        "summary": "An attachment's details",
        "responses": {
          "200": {
            "description": "The attachment.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Attachment" } } }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "delete": {
        "tags": ["Attachments"],
        "operationId": "deleteAttachment",
        "summary": "Delete an attachment",
        "description": "Needs the write scope, and the uploader or a board owner or admin, like the card panel. The file and its thumbnail are removed from storage. Records \"removed <file>\" in the card history and sends `card.updated` with `attachments` in `changes`.",
        "responses": {
          "204": { "description": "Deleted. No body." },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/attachments/{attachmentId}/content": {
      "parameters": [{ "$ref": "#/components/parameters/AttachmentId" }],
      "get": {
        "tags": ["Attachments"],
        "operationId": "downloadAttachment",
        "summary": "Download the file",
        "description": "The original bytes, streamed from storage, with `Content-Disposition: attachment` and the original file name. HTML, SVG, XML, JavaScript and PDF are sent as `application/octet-stream`. With `thumb=1`, the WebP thumbnail of a large image (the original until the thumbnail exists, or for other files). This is the `downloadUrl` and `thumbnailUrl` of an attachment; it needs the same bearer token.",
        "parameters": [
          {
            "name": "thumb",
            "in": "query",
            "required": false,
            "description": "`1` for the WebP thumbnail.",
            "schema": { "type": "string", "enum": ["1"] }
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/search": {
      "get": {
        "tags": ["Search"],
        "operationId": "search",
        "summary": "Search cards",
        "description": "The command palette's search: card titles, descriptions and comments in the full-text index, accent-insensitive (also Polish ł), every word must match, each as the start of a word. Only boards the user can open are searched (every board for admins); archived boards are left out, archived cards are found and marked `archived`. Best match first, a title match above a description or comment match. Find boards by name with `GET /boards`.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "The search text, 1 to 200 characters. Text without letters or digits finds nothing (an empty page).",
            "schema": { "type": "string", "minLength": 1, "maxLength": 200 }
          },
          { "$ref": "#/components/parameters/Limit" },
          { "$ref": "#/components/parameters/Cursor" }
        ],
        "responses": {
          "200": {
            "description": "A page of matching cards.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data", "next"],
                  "properties": {
                    "data": { "type": "array", "items": { "$ref": "#/components/schemas/SearchHit" } },
                    "next": { "$ref": "#/components/schemas/NextCursor" }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "422": {
            "description": "`q` is missing, blank or longer than 200 characters, or `limit` or `cursor` is not valid (`validation_failed`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/boards/{boardId}/automations": {
      "parameters": [{ "$ref": "#/components/parameters/BoardId" }],
      "get": {
        "tags": ["Automations"],
        "operationId": "listAutomations",
        "summary": "Automation rules of a board",
        "description": "Every board member can read the rules; board owners and admins can add, change and delete them here or in board settings.",
        "responses": {
          "200": {
            "description": "All rules, oldest first (the order they run in).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Automation" } } }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "post": {
        "tags": ["Automations"],
        "operationId": "createAutomation",
        "summary": "Add an automation rule",
        "description": "Needs the write scope and a board owner or an admin, like board settings. The body is the shape the list returns, without the generated fields. Columns, tags and people the rule names must be on the board (people as active members); the ones that are not are listed in `details` (`columnIds`, `tagIds`, `userIds`). New rules run last. Recorded in the audit log (`automation.create`).",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AutomationCreate" } } }
        },
        "responses": {
          "201": {
            "description": "The new rule.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Automation" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": {
            "description": "The board already has 50 rules (`limit_reached`).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/automations/{ruleId}": {
      "parameters": [{ "$ref": "#/components/parameters/RuleId" }],
      "patch": {
        "tags": ["Automations"],
        "operationId": "updateAutomation",
        "summary": "Change, enable or disable an automation rule",
        "description": "Needs the write scope and a board owner or an admin. Send only the fields to change; the rule after the change must be valid as a whole, so switching `trigger` usually needs new `actions` (and a `columnId` for `cardEntersColumn`; it is cleared for `deadlinePassed`). `actions` replaces the whole list. Recorded in the audit log (`automation.update`).",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AutomationUpdate" } } }
        },
        "responses": {
          "200": {
            "description": "The rule after the change.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Automation" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": { "$ref": "#/components/responses/ValidationFailed" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      },
      "delete": {
        "tags": ["Automations"],
        "operationId": "deleteAutomation",
        "summary": "Delete an automation rule",
        "description": "Needs the write scope and a board owner or an admin. Past runs stay in the card history. Recorded in the audit log (`automation.delete`).",
        "responses": {
          "204": { "description": "Deleted. No body." },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": ["Account"],
        "operationId": "getOpenApi",
        "summary": "This document",
        "security": [],
        "responses": { "200": { "description": "The OpenAPI description.", "content": { "application/json": { "schema": { "type": "object" } } } } }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A personal access token from Settings, API tokens (`kbn_` followed by 64 hex characters)."
      }
    },
    "parameters": {
      "BoardId": { "name": "boardId", "in": "path", "required": true, "schema": { "type": "string" } },
      "ColumnId": { "name": "columnId", "in": "path", "required": true, "schema": { "type": "string" } },
      "CardId": { "name": "cardId", "in": "path", "required": true, "schema": { "type": "string" } },
      "ItemId": {
        "name": "itemId",
        "in": "path",
        "required": true,
        "description": "A checklist item id.",
        "schema": { "type": "string" }
      },
      "AttachmentId": { "name": "attachmentId", "in": "path", "required": true, "schema": { "type": "string" } },
      "RuleId": {
        "name": "ruleId",
        "in": "path",
        "required": true,
        "description": "An automation rule id.",
        "schema": { "type": "string" }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Items per page.",
        "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "The `next` value of the previous page.",
        "schema": { "type": "string" }
      }
    },
    "responses": {
      "BadRequest": { "description": "The body is not a JSON object.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Unauthorized": {
        "description": "Missing, invalid, expired or revoked token, or the user is deactivated.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "Forbidden": {
        "description": "The user can not access this board, or the token lacks the write scope (`insufficient_scope`).",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "NotFound": { "description": "No such resource.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "ValidationFailed": {
        "description": "The input is not valid; `details` lists the problems.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "RateLimited": {
        "description": "Too many requests. Wait for `Retry-After` seconds.",
        "headers": { "Retry-After": { "schema": { "type": "integer" } } },
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "unauthorized",
                  "forbidden",
                  "insufficient_scope",
                  "not_found",
                  "card_archived",
                  "idempotency_key_conflict",
                  "invalid_idempotency_key",
                  "tag_exists",
                  "limit_reached",
                  "payload_too_large",
                  "unsupported_media_type",
                  "validation_failed",
                  "rate_limited",
                  "internal_error",
                  "storage_unavailable"
                ]
              },
              "message": { "type": "string" },
              "details": {}
            }
          }
        }
      },
      "NextCursor": { "type": ["string", "null"], "description": "Pass as `cursor` for the next page; null on the last page." },
      "UserRef": {
        "type": "object",
        "required": ["id", "username", "displayName"],
        "properties": {
          "id": { "type": "string" },
          "username": { "type": "string" },
          "displayName": { "type": ["string", "null"] }
        }
      },
      "Me": {
        "type": "object",
        "required": ["id", "username", "displayName", "role", "token"],
        "properties": {
          "id": { "type": "string" },
          "username": { "type": "string" },
          "displayName": { "type": ["string", "null"] },
          "role": { "type": "string", "enum": ["admin", "member"] },
          "token": {
            "type": "object",
            "required": ["id", "name", "scope", "expiresAt"],
            "properties": {
              "id": { "type": "string" },
              "name": { "type": "string" },
              "scope": { "type": "string", "enum": ["read", "write"] },
              "expiresAt": { "type": ["string", "null"], "format": "date-time" }
            }
          }
        }
      },
      "Board": {
        "type": "object",
        "required": ["id", "name", "description", "color", "archived", "autoArchiveAfterDays", "createdAt", "updatedAt"],
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "description": { "type": ["string", "null"] },
          "color": { "type": "string", "examples": ["#2563eb"] },
          "archived": { "type": "boolean", "description": "The board itself is archived (not to be confused with archived cards)." },
          "autoArchiveAfterDays": {
            "type": ["integer", "null"],
            "minimum": 1,
            "maximum": 365,
            "description": "Cards in the board's last column for this many days are archived automatically (checked hourly); null when off. Set in board settings."
          },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "BoardDetail": {
        "allOf": [
          { "$ref": "#/components/schemas/Board" },
          {
            "type": "object",
            "required": ["columns", "tags"],
            "properties": {
              "columns": { "type": "array", "items": { "$ref": "#/components/schemas/Column" } },
              "tags": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } }
            }
          }
        ]
      },
      "Column": {
        "type": "object",
        "required": ["id", "boardId", "name", "position", "wipLimit"],
        "properties": {
          "id": { "type": "string" },
          "boardId": { "type": "string" },
          "name": { "type": "string" },
          "position": { "type": "integer", "minimum": 0 },
          "wipLimit": { "type": ["integer", "null"] }
        }
      },
      "ColumnCreate": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 80 },
          "wipLimit": { "type": ["integer", "null"], "minimum": 1, "maximum": 999 }
        }
      },
      "ColumnUpdate": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 80 },
          "wipLimit": { "type": ["integer", "null"], "minimum": 1, "maximum": 999 },
          "position": { "type": "integer", "minimum": 0 }
        }
      },
      "Tag": {
        "type": "object",
        "required": ["id", "boardId", "name", "color"],
        "properties": {
          "id": { "type": "string" },
          "boardId": { "type": "string" },
          "name": { "type": "string" },
          "color": { "type": "string" }
        }
      },
      "TagCreate": {
        "type": "object",
        "required": ["name", "color"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 40, "description": "Unique on the board, ignoring case." },
          "color": {
            "type": "string",
            "pattern": "^#?[0-9a-fA-F]{6}$",
            "description": "Hex color, with or without `#`; returned with it.",
            "examples": ["#dc2626"]
          }
        }
      },
      "Automation": {
        "type": "object",
        "required": ["id", "boardId", "name", "trigger", "columnId", "actions", "enabled", "createdAt", "updatedAt"],
        "properties": {
          "id": { "type": "string" },
          "boardId": { "type": "string" },
          "name": { "type": "string" },
          "trigger": {
            "type": "string",
            "enum": ["cardEntersColumn", "deadlinePassed"],
            "description": "cardEntersColumn: a card is moved into (or created in) `columnId`. deadlinePassed: the day of a card's deadline is over (checked every few minutes)."
          },
          "columnId": { "type": ["string", "null"], "description": "The column of a cardEntersColumn rule; null for deadlinePassed." },
          "actions": { "type": "array", "items": { "$ref": "#/components/schemas/AutomationAction" } },
          "enabled": { "type": "boolean" },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "AutomationAction": {
        "type": "object",
        "required": ["type"],
        "description": "What a rule does. cardEntersColumn rules use assign, unassignAll, addTag, removeTag, setPriority, setDeadline, clearDeadline and completeChecklist; deadlinePassed rules use moveToColumn and addTag.",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["assign", "unassignAll", "addTag", "removeTag", "setPriority", "setDeadline", "clearDeadline", "completeChecklist", "moveToColumn"]
          },
          "userIds": { "type": "array", "items": { "type": "string" }, "description": "assign: board members to add as assignees." },
          "tagId": { "type": "string", "description": "addTag, removeTag." },
          "priority": { "$ref": "#/components/schemas/Priority" },
          "days": { "type": "integer", "minimum": 0, "maximum": 365, "description": "setDeadline: today (UTC) plus this many days." },
          "columnId": { "type": "string", "description": "moveToColumn." }
        }
      },
      "Priority": { "type": "string", "enum": ["low", "normal", "high", "critical"] },
      "Deadline": {
        "type": ["string", "null"],
        "description": "A calendar date, YYYY-MM-DD. Requests also accept an ISO date-time (its UTC date is used).",
        "examples": ["2026-12-31"]
      },
      "Card": {
        "type": "object",
        "required": [
          "id",
          "boardId",
          "columnId",
          "title",
          "description",
          "position",
          "priority",
          "deadline",
          "coverColor",
          "createdBy",
          "assignees",
          "tags",
          "archived",
          "archivedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": { "type": "string" },
          "boardId": { "type": "string" },
          "columnId": { "type": "string" },
          "title": { "type": "string" },
          "description": { "type": ["string", "null"], "description": "Markdown." },
          "position": { "type": "integer", "minimum": 0 },
          "priority": { "$ref": "#/components/schemas/Priority" },
          "deadline": { "$ref": "#/components/schemas/Deadline" },
          "coverColor": { "type": ["string", "null"] },
          "createdBy": { "oneOf": [{ "$ref": "#/components/schemas/UserRef" }, { "type": "null" }] },
          "assignees": { "type": "array", "items": { "$ref": "#/components/schemas/UserRef" } },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "name", "color"],
              "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "color": { "type": "string" } }
            }
          },
          "archived": { "type": "boolean", "description": "Archived cards are off the board but keep their column and position." },
          "archivedAt": { "type": ["string", "null"], "format": "date-time", "description": "When the card was archived; null on the board." },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "CardCreate": {
        "type": "object",
        "required": ["columnId", "title"],
        "properties": {
          "columnId": { "type": "string" },
          "title": { "type": "string", "minLength": 1, "maxLength": 200 },
          "description": { "type": ["string", "null"], "maxLength": 20000 },
          "priority": { "$ref": "#/components/schemas/Priority" },
          "deadline": { "$ref": "#/components/schemas/Deadline" },
          "position": { "type": "integer", "minimum": 0, "description": "Defaults to the end of the column." },
          "assigneeIds": { "type": "array", "items": { "type": "string" }, "maxItems": 50, "description": "Active members of the board." },
          "tagIds": { "type": "array", "items": { "type": "string" }, "maxItems": 50 }
        }
      },
      "CardUpdate": {
        "type": "object",
        "properties": {
          "title": { "type": "string", "minLength": 1, "maxLength": 200 },
          "description": { "type": ["string", "null"], "maxLength": 20000 },
          "priority": { "$ref": "#/components/schemas/Priority" },
          "deadline": { "$ref": "#/components/schemas/Deadline" },
          "columnId": { "type": "string", "description": "Move to this column of the same board." },
          "position": { "type": "integer", "minimum": 0, "description": "Position in the (new) column; moving to another column without it puts the card at the end." },
          "assigneeIds": { "type": "array", "items": { "type": "string" }, "maxItems": 50 },
          "tagIds": { "type": "array", "items": { "type": "string" }, "maxItems": 50 },
          "archived": { "type": "boolean", "description": "true archives the card, false restores it to its column." }
        }
      },
      "Comment": {
        "type": "object",
        "required": ["id", "cardId", "body", "author", "createdAt", "updatedAt"],
        "properties": {
          "id": { "type": "string" },
          "cardId": { "type": "string" },
          "body": { "type": "string" },
          "author": { "oneOf": [{ "$ref": "#/components/schemas/UserRef" }, { "type": "null" }] },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "ChecklistItem": {
        "type": "object",
        "required": [
          "id",
          "cardId",
          "title",
          "done",
          "position",
          "assignee",
          "dueDate",
          "completedAt",
          "completedBy",
          "createdAt"
        ],
        "properties": {
          "id": { "type": "string" },
          "cardId": { "type": "string" },
          "title": { "type": "string" },
          "done": { "type": "boolean" },
          "position": { "type": "integer", "minimum": 0 },
          "assignee": { "oneOf": [{ "$ref": "#/components/schemas/UserRef" }, { "type": "null" }] },
          "dueDate": {
            "type": ["string", "null"],
            "description": "A calendar date, YYYY-MM-DD. Requests also accept an ISO date-time (its UTC date is used).",
            "examples": ["2026-12-31"]
          },
          "completedAt": { "type": ["string", "null"], "format": "date-time" },
          "completedBy": { "oneOf": [{ "$ref": "#/components/schemas/UserRef" }, { "type": "null" }] },
          "createdAt": { "type": "string", "format": "date-time" }
        }
      },
      "ChecklistItemCreate": {
        "type": "object",
        "required": ["title"],
        "properties": {
          "title": { "type": "string", "minLength": 1, "maxLength": 200 },
          "assigneeId": { "type": ["string", "null"], "description": "An active member of the board." },
          "dueDate": {
            "type": ["string", "null"],
            "description": "A calendar date, YYYY-MM-DD. Requests also accept an ISO date-time (its UTC date is used).",
            "examples": ["2026-12-31"]
          },
          "position": { "type": "integer", "minimum": 0, "description": "0-based place in the checklist; defaults to the end." }
        }
      },
      "ChecklistItemUpdate": {
        "type": "object",
        "properties": {
          "title": { "type": "string", "minLength": 1, "maxLength": 200 },
          "done": { "type": "boolean" },
          "assigneeId": { "type": ["string", "null"], "description": "An active member of the board; null unassigns." },
          "dueDate": {
            "type": ["string", "null"],
            "description": "A calendar date, YYYY-MM-DD. Requests also accept an ISO date-time (its UTC date is used).",
            "examples": ["2026-12-31"]
          },
          "position": { "type": "integer", "minimum": 0, "description": "0-based place in the checklist (clamped to the end)." }
        }
      },
      "Attachment": {
        "type": "object",
        "required": [
          "id",
          "cardId",
          "fileName",
          "mimeType",
          "size",
          "width",
          "height",
          "uploader",
          "createdAt",
          "downloadUrl",
          "thumbnailUrl"
        ],
        "properties": {
          "id": { "type": "string" },
          "cardId": { "type": "string" },
          "fileName": { "type": "string" },
          "mimeType": {
            "type": "string",
            "description": "Sniffed from the bytes for PNG, JPEG, GIF and WebP; otherwise the type sent with the upload, or application/octet-stream."
          },
          "size": { "type": "integer", "description": "Bytes." },
          "width": { "type": ["integer", "null"], "description": "Pixels, for images." },
          "height": { "type": ["integer", "null"] },
          "uploader": { "oneOf": [{ "$ref": "#/components/schemas/UserRef" }, { "type": "null" }] },
          "createdAt": { "type": "string", "format": "date-time" },
          "downloadUrl": {
            "type": "string",
            "description": "Path of the file under this server, e.g. /api/v1/attachments/{id}/content. Needs the bearer token."
          },
          "thumbnailUrl": {
            "type": ["string", "null"],
            "description": "The WebP thumbnail of an image wider than 480 pixels (the original until it exists); null for other files."
          }
        }
      },
      "SearchHit": {
        "type": "object",
        "required": ["id", "boardId", "boardName", "columnId", "columnName", "title", "archived", "snippet", "highlights"],
        "properties": {
          "id": { "type": "string", "description": "The card id; read the card with GET /cards/{cardId}." },
          "boardId": { "type": "string" },
          "boardName": { "type": "string" },
          "columnId": { "type": "string" },
          "columnName": { "type": "string" },
          "title": { "type": "string" },
          "archived": { "type": "boolean" },
          "snippet": {
            "type": ["string", "null"],
            "description": "Plain text around the match in the description or a comment; null when only the title matched."
          },
          "highlights": {
            "type": "array",
            "description": "The matched words in `snippet`, as [start, end) offsets in UTF-16 code units.",
            "items": {
              "type": "object",
              "required": ["start", "end"],
              "properties": { "start": { "type": "integer" }, "end": { "type": "integer" } }
            }
          }
        }
      },
      "AutomationCreate": {
        "type": "object",
        "required": ["name", "trigger", "actions"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 80 },
          "trigger": { "type": "string", "enum": ["cardEntersColumn", "deadlinePassed"] },
          "columnId": {
            "type": ["string", "null"],
            "description": "Required for cardEntersColumn; ignored (stored as null) for deadlinePassed."
          },
          "actions": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": { "$ref": "#/components/schemas/AutomationAction" },
            "description": "Only the trigger's own action types (see AutomationAction)."
          },
          "enabled": { "type": "boolean", "default": true }
        }
      },
      "AutomationUpdate": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 80 },
          "trigger": { "type": "string", "enum": ["cardEntersColumn", "deadlinePassed"] },
          "columnId": { "type": ["string", "null"] },
          "actions": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": { "$ref": "#/components/schemas/AutomationAction" }
          },
          "enabled": { "type": "boolean" }
        }
      },
      "Trashed": {
        "type": "object",
        "required": ["id", "trashId"],
        "properties": { "id": { "type": "string" }, "trashId": { "type": "string" } }
      }
    }
  }
}
